• 四、字段大全


    一、

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using YKERP.BaseForms;
    using YKERP.Business;
    using YKERP.Tools;
    
    namespace YKERP.StoreADJ
    {
        public partial class StoreFiRE : YKBaseForm
        {
            public StoreFiRE()
            {
                InitializeComponent();
                BindCtrlData();
                Select_just_dates.Value = DateTime.Now.AddDays(-7);
                Date_account_dates.Value = DateTime.Now.AddDays(-7);
    
    
                //Edit_if_costadjust.ItemIndex =1;
    
    
            }
    
            public  void BindCtrlData()
            {
    
                gridview_product.BindComboEditor("status_num_id", CommonDicType.调拨单状态);
                gridview_product.BindComboEditor("sub_unit_num_id", CommonDicType.门店);
                gridview_product.BindComboEditor("div_num_id", CommonDicType.部类);
    
                gridview_product.BindComboEditor("create_user_id", CommonDicType.人员);
                gridview_product.BindComboEditor("last_update_user_id", CommonDicType.人员);
    
                var apple_type = new List<object>() {
                   new { id = "0", name = "全部" },
                   new { id = "1", name = "新增合同" },
                   new { id = "2", name = "续签合同" },
                   new { id = "3", name = "截至合同" },
                   new { id = "4", name = "打回合同" }
               };
                Edit_so_from_type.BindDataTable(YKTool.listToDataTable(apple_type));
                gridview_product.BindComboEditor("so_from_type", YKTool.listToDataTable(apple_type));
    
    
                var type_num = new List<object>() {
                   new { id = "1", name = "指定批次调价" },
                   new { id = "2", name = "只调低价格" },
                   new { id = "3", name = "指定价格调整" },
               };
                Select_type_num_id.BindDataTable(YKTool.listToDataTable(type_num));
                gridview_product.BindComboEditor("type_num_id", YKTool.listToDataTable(type_num));
    
    
                var costadjust = new List<object>() {
                   new { id = "0", name = "否" },
                   new { id = "1", name = "是" },
               };
                Edit_if_costadjust.BindDataTable(YKTool.listToDataTable(costadjust));
    
    
            }
    
            /// <summary>
            /// 查询数据
            /// </summary>
            private void SearchData()
            {
                GridPage.ClearQueryField();
              
                GridPage.IN_SQLID = "YKERP-WM-0331";
                GridPage.IN_GRID_CONTROL = gridview_FiRE;
    
                //调整单号 文本框的
                if (!string.IsNullOrWhiteSpace(Txt_reserved_no.Text)) 
                {
                    GridPage.AddQueryField("reserved_no", Txt_reserved_no.Text);
                }
                 //门店
                var status_num_id = Select_sub_unit_num_id.GetSelectedSubUnit();
                if (status_num_id !=null)
                {
                    GridPage.AddQueryField("sub_unit_num_id", status_num_id.sub_unit_num_id);
                }
    
             
                var div_num_id = Select_div_num_id.GetSelectedProdDiv();
                //商品部类
                if (div_num_id != null) //文本框的
                {
                    GridPage.AddQueryField("div_num_id", div_num_id.div_num_id.ToString());
                }
    
                
                 
               //调整时间  开始时间
               if (!string.IsNullOrWhiteSpace(Select_just_dates.Text)) //文本框的
               {
                   GridPage.AddQueryField("just_dates", Select_just_dates.Text);
               }
    
               //调整时间  结束时间
               if (!string.IsNullOrWhiteSpace(Select_just_dated.Text)) //文本框的
               {
                   GridPage.AddQueryField("just_dated", Select_just_dated.Text);
               }
    
    
                var so_from_typ = Edit_so_from_type.EditValue?.ToString()?.ToInt() ?? 0;
                //来源
                if (!string.IsNullOrWhiteSpace(Edit_so_from_type.Text)) //文本框的
                {
                    GridPage.AddQueryField("so_from_type", so_from_typ.ToString());
                }
    
                //业务类型
    
    
    
                var num_id = Select_type_num_id.EditValue?.ToString()?.ToInt() ?? 0;
                if (num_id > 0) //文本框的
                {
                    GridPage.AddQueryField("type_num_id", num_id.ToString());
                }
    
                //记账时间  开始时间
                if (!string.IsNullOrWhiteSpace(Date_account_dates.Text)) //文本框的
                {
                    GridPage.AddQueryField("account_dates", Date_account_dates.Text);
                }
                //记账时间  结束时间
                if (!string.IsNullOrWhiteSpace(Date_account_dated.Text)) //文本框的
                {
                    GridPage.AddQueryField("account_dated", Date_account_dated.Text);
                }
    
              
                 
               //条码
               if (!string.IsNullOrWhiteSpace(Txt_barcode.Text)) //文本框的
               {
                   GridPage.AddQueryField("barcode", Txt_barcode.Text);
               }
    
                var Txt_item_num = Txt_item_num_id.GetSelectedProduct();
               //商品名字
               if (Txt_item_num!=null) //文本框的
               {
                   GridPage.AddQueryField("item_num_id", Txt_item_num.item_num_id);
               }
    
                var status_num = Select_status_num_id.GetSelectedDirectTransStatus();
                //状态       二、 这个对应不上
                if (status_num!=null) //  没有用到 
               {
                   GridPage.AddQueryField("status_num_id", status_num.type_num_id);
               }
    
                var create_user_id = Select_create_user_id.GetSelectedUser();
                //创建人
                if (create_user_id!=null) //文本框的
               {
                    GridPage.AddQueryField("create_user_id", create_user_id.empe_num_id);
               }
    
    
                var if_costadjust = Edit_if_costadjust.EditValue?.ToString()?.ToInt() ?? 0;
                //是否产生供应商金额调整单
                if (if_costadjust>0) //文本框的
               {
                   GridPage.AddQueryField("if_costadjust", if_costadjust.ToString());
               }
    
                GridPage.InitPages();
            }
    
            private void BtnSearch_Click(object sender, EventArgs e)
            {
                this.ShowLoading("正在查询,请稍候...");
                SearchData();
                this.HideLoading();
            }
    
            private void spBtnReset_Click(object sender, EventArgs e)
            {
                this.ClearInputData();
            }
    
            /// <summary>
            /// 清空控件输入值
            /// </summary>
            private void ClearInputData()
            {
                Txt_reserved_no.Text = "";
                Select_sub_unit_num_id.Clear();//门店
                Select_div_num_id.Clear();
                Select_just_dates.SetText(""); //日期
                Select_just_dated.SetText("");
                Edit_so_from_type.EditValue = "";//下拉框
                Select_type_num_id.EditValue = "";
         
                Date_account_dates.SetText("");
                Date_account_dated.SetText("");
                Txt_barcode.Text = "";
                Txt_item_num_id.Clear();
                Select_status_num_id.Clear();
                Select_create_user_id.Clear();
                Edit_if_costadjust.EditValue = "";
            }
    
    
        }
    }
    

      

  • 相关阅读:
    python
    python
    Django+Scrapy结合使用并爬取数据入库
    python--scrapy框架爬取分页数据与详情页数据
    python--简单的jQuery-Ajax使用
    python--scrapy框架配置redis数据库或者mongdb数据库
    ajax分页
    django分页
    Jquery获取输入框属性file,ajax传输后端,下载图片
    Django中web开发用md5加密图片名并存储静态文件夹
  • 原文地址:https://www.cnblogs.com/fger/p/10403630.html
Copyright © 2020-2023  润新知