Beispiel #1
0
        /// <summary>
        /// ��ȡϸ��
        /// </summary>
        /// <returns></returns>
        public DataTable SearchBillDetail(BillMaster billMaster)
        {
            string parameter = @"Parameter={'Method':'getDetail','ProductCode': '" + "" + "','OperateType':'" + billMaster.BillType + "','OperateArea':'" + "1,2,3" + "','Operator':'" + Dns.GetHostName() + "','BillMasters':" + JsonConvert.SerializeObject(new BillMaster[] { billMaster }) + "}";
            string msg = util.GetDataFromServer(parameter);
            Result r = JsonConvert.DeserializeObject<Result>(msg);

            DataTable table = GenDetailTable();

            for (int i = 0; i < r.BillDetails.Length; i++)
            {
                DataRow row = table.NewRow();

                row["DetailID"] = r.BillDetails[i].DetailID;
                row["operateStorageName"] = r.BillDetails[i].StorageName;
                row["targetStorageName"] = r.BillDetails[i].TargetStorageName;
                row["operateName"] = r.BillDetails[i].BillTypeName;
                row["operateProductName"] = r.BillDetails[i].ProductName;
                row["operatePieceQuantity"] = r.BillDetails[i].PieceQuantity;
                row["operateBarQuantity"] = r.BillDetails[i].BarQuantity;
                row["StatusName"] = r.BillDetails[i].StatusName;

                table.Rows.Add(row);
            }

            return table;
        }
Beispiel #2
0
 public SelectDialog(BillMaster [] billMasters)
 {
     InitializeComponent();
     cbBillID.DataSource = billMasters;
     cbBillID.DisplayMember = "BillNo";
     cbBillID.ValueMember = "BillNo";
     cbBillID.SelectedIndex = 0;
 }
Beispiel #3
0
 public SelectDialog(BillMaster [] billMasters)
 {
     InitializeComponent();
     //cbBillID.DataSource = billMasters;
     foreach (var row in billMasters)
     {
         cbBillIDCheck.Items.Add(row.BillNo);
     }
     //cbBillIDCheck.Size.Height = 59;
     cbBillIDCheck.DisplayMember = "BillNo";
     cbBillIDCheck.ValueMember = "BillNo";
     cbBillIDCheck.SelectedIndex = 0;
 }
Beispiel #4
0
 //��ѯѡ�����������������δִ��ϸ����
 public void SearchBillDetail(BillMaster[] billMasters, string productCode, string operateType,string OperateArea, string @operator)
 {
     taskType = "getBillDetail";
     WebClient client = new WebClient();
     client.Headers["Content-Type"] = @"application/x-www-form-urlencoded; charset=UTF-8";
     string parameter = JsonMapper.ToJson(billMasters);
     client.UploadStringAsync(url, "post", @"Parameter={'Method':'getDetail','ProductCode': '" + productCode + "','OperateType':'" + operateType + "','OperateArea':'" + OperateArea + "','Operator':'" + @operator + "','BillMasters':" + parameter + "}");
     client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadStringCompleted);
 }
Beispiel #5
0
 //��ѯ
 private void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         string billNo = string.Empty;
         Task task = new Task(url);
         task.GetBillMasterCompleted += new Task.GetBillMasterCompletedEventHandler(delegate(bool isSuccess, string msg, BillMaster[] billMasters)
         {
             ClosePlWailt();
             if (billMasters != null)
             {
                 switch (billMasters.Length)
                 {
                     case 0:
                         billNo = "";
                         break;
                     case 1:
                         billNo = billMasters[0].BillNo;
                         break;
                     default:
                         SelectDialog selectDialog = new SelectDialog(billMasters);
                         if (selectDialog.ShowDialog() == DialogResult.OK)
                         {
                             billNo = selectDialog.SelectedBillID;
                         }
                         break;
                 }
                 foreach (BillMaster billMaster in billMasters)
                 {
                     if (billNo == billMaster.BillNo)
                     {
                         this.BillMaster = billMaster;
                     }
                 }
             }
             if (!isSuccess)
                 MessageBox.Show(msg);
             RefreshData();
         });
         task.SearchBillMaster(BillTypes);
         DisplayPlWailt();
     }
     catch (Exception ex)
     {
         MessageBox.Show("��ȡ����ʧ�ܣ�ԭ��" + ex.Message, "��Ϣ", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #6
0
        private void BaseTaskForm_Load(object sender, EventArgs e)
        {
            this.label2.Text = billId;
            switch (billType)
            {
                case "1":
                    this.label2.Text += "(���)";
                    break;
                case "2":
                    this.label2.Text += "(����)";
                    break;
                case "3":
                    this.label2.Text += "(�ƿ�)";
                    break;
                case "4":
                    this.label2.Text += "(�̵�)";
                    break;
            }
            DataTable tempTable = null;
            if (SystemCache.ConnetionType == "USB����")
            {
                tempTable = new DataTable();
                tempTable.Columns.Add("STORAGEID");
                tempTable.Columns.Add("OPERATENAME");
                tempTable.Columns.Add("TOBACCONAME");
                tempTable.Columns.Add("STATENAME");
                tempTable.Columns.Add("DETAILID");
                DataRow[] detailRows = SystemCache.DetailTable.Select("MASTER='" + billId + "' AND ConfirmState <> '3'");
                for (int i = 0; i < detailRows.Length; i++)
                {
                    DataRow row = tempTable.NewRow();
                    row["STORAGEID"] = detailRows[i]["STORAGEID"];
                    row["OPERATENAME"] = detailRows[i]["OPERATENAME"];
                    row["TOBACCONAME"] = detailRows[i]["TOBACCONAME"];
                    row["STATENAME"] = detailRows[i]["STATENAME"];
                    row["DETAILID"] = detailRows[i]["DETAILID"];
                    tempTable.Rows.Add(row);
                }
            }
            else
            {
                BillMaster billMaster = new BillMaster();
                billMaster.BillNo = billId;
                billMaster.BillType = billType;

                tempTable = httpDataDal.SearchBillDetail(billMaster);
                detailTable = tempTable;

            }
            this.dgInfo.DataSource = tempTable;
            if (tempTable.Rows.Count == 0)
            {
                this.btnNext.Enabled = false;
            }

            DataGridTableStyle gridStyle = new DataGridTableStyle();
            gridStyle.MappingName = tempTable.TableName;
            dgInfo.TableStyles.Add(gridStyle);
            GridColumnStylesCollection columnStyles = this.dgInfo.TableStyles[0].GridColumnStyles;

            columnStyles["operateStorageName"].HeaderText = "   ��  λ";
            columnStyles["operateStorageName"].Width = 100;
            columnStyles["operateProductName"].HeaderText = "   ��  ��";
            columnStyles["operateProductName"].Width = 120;
            columnStyles["operateName"].HeaderText = "  ��  ��";
            columnStyles["operateName"].Width = 50;
            columnStyles["StatusName"].HeaderText = "  ״̬";
            columnStyles["StatusName"].Width = 50;
            columnStyles["DetailID"].HeaderText = "���ݺ�";
            //����ʾ�������Ϊ0
            columnStyles["operateName"].Width = 0;
            columnStyles["DetailID"].Width = 0;
            columnStyles["operatePieceQuantity"].Width = 0;
            columnStyles["operateBarQuantity"].Width = 0;
            columnStyles["targetStorageName"].Width = 0;

            if (tempTable.Rows.Count != 0)
            {
                if (tempTable.Rows.Count <= index)
                {
                    index = tempTable.Rows.Count-1;
                }
                dgInfo.Select(index);
                dgInfo.CurrentRowIndex = index;
                dgInfo.Focus();
            }
            WaitCursor.Restore();
        }