Esempio n. 1
0
        void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Business.Models.DirectSalesModel dsom = this.dataGridView2.Rows[e.RowIndex].DataBoundItem as Business.Models.DirectSalesModel;
            #region 查看详情
            //var dso = this.PharmacyDatabaseService.GetDirectSalesOrder(dsom.DirectSalesOrderId,out msg);
            //using (Forms.DrugsUnqualification.FormUnqualificationApprovalDetail f = new Forms.DrugsUnqualification.FormUnqualificationApprovalDetail())
            //{
            //    using (UserControls.UCDirectSales ucf = new UserControls.UCDirectSales(dso))
            //    {
            //        f.Height += ucf.Height;
            //        f.Controls.Add(ucf);
            //        ucf.Dock = DockStyle.Fill;
            //        f.ShowDialog();
            //    }
            //}
            #endregion

            #region 打开验收单据
            using (Form_CheckingOrder frm = new Form_CheckingOrder(dsom))
            {
                frm.ShowDialog();
                if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    this.Search();
                }
            }

            #endregion
        }
Esempio n. 2
0
        void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.dataGridView2.Columns[e.ColumnIndex].Name == this.Column22.Name)
            {
                return;
            }

            this.ClearCurrent();
            this.FStatus.FStatus = FormStatusEnum.Edit;
            Business.Models.DirectSalesModel dsom = this.dataGridView2.Rows[e.RowIndex].DataBoundItem as Business.Models.DirectSalesModel;

            var dsod = this.PharmacyDatabaseService.GetDirectSalesOrderDetailModelByDirectSalesModel(dsom.DirectSalesOrderId, out msg);

            dsod.ToList <Business.Models.DirectSalesOrderDetailModel>().ForEach(r => { this._ListDirectSalesDetail.Add(r); });
            this.label2.Text       = dsom.SupplyUnitName;
            this.label5.Text       = dsom.PurchaseUnitName;
            this.textBox4.Text     = dsom.Checker;
            this.richTextBox1.Text = dsom.Memo;
            this._SupplyUnit       = this.PharmacyDatabaseService.GetSupplyUnit(out msg, dsom.SupplyUnitId);
            this._PurchaseUnit     = this.PharmacyDatabaseService.GetPurchaseUnit(out msg, dsom.PurchaseUnitId);
            this.dsOrder           = this.PharmacyDatabaseService.GetDirectSalesOrder(dsom.DirectSalesOrderId, out msg);

            this._Id = dsom.DirectSalesOrderId;
            this.dataGridView1.Refresh();
        }
Esempio n. 3
0
        public Form_CheckingOrder(Business.Models.DirectSalesModel dso)
        {
            InitializeComponent();

            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;

            this._dso        = dso;
            this._CurrentDso = this.PharmacyDatabaseService.GetDirectSalesOrder(dso.DirectSalesOrderId, out msg);

            bool IsUnChecked = this._CurrentDso.CheckStatusValue == (int)DirectSalesSatus.UnChecked;

            this.toolStripButton1.Enabled          = IsUnChecked;
            this.textBox1.Enabled                  = IsUnChecked;
            this.dataGridView1.ReadOnly            = !IsUnChecked;
            this.dataGridView1.AutoGenerateColumns = false;

            #region 事件
            this.dataGridView1.RowPostPaint += delegate(object o, DataGridViewRowPostPaintEventArgs ex) { DataGridViewOperator.SetRowNumber((DataGridView)o, ex); };
            this.dataGridView1.DataError    += dataGridView1_DataError;
            #endregion

            #region 数据绑定
            var dsod = this.PharmacyDatabaseService.GetDirectSalesOrderDetailModelByDirectSalesModel(dso.DirectSalesOrderId, out msg).OrderBy(r => r.ProducGeneralName);

            if (IsUnChecked)
            {
                dsod.ForEach(v =>
                {
                    v.BatchNumber     = string.Empty;
                    v.CheckMethod     = "正常";
                    v.Origin          = string.Empty;
                    v.OutValidDate    = DateTime.Now.Date;
                    v.ProductDate     = DateTime.Now;
                    v.QualityNumber   = v.Amount;
                    v.QualityMemo     = "验收合格";
                    v.UnqualityNumber = 0;
                    v.UnqualityMemo   = "无";
                });
            }

            this._CurrentDirectSalesOrderDetailModel = dsod.ToList();
            this.dataGridView1.DataSource            = new BindingCollection <Business.Models.DirectSalesOrderDetailModel>(this._CurrentDirectSalesOrderDetailModel);
            this.label8.Text             = dso.SupplyUnitName;
            this.label9.Text             = dso.PurchaseUnitName;
            this.label7.Text             = dso.DocumentNumber;
            this.richTextBox1.Text       = dso.Memo;
            this.label12.Text            = dso.Createtime.ToString();
            this.label10.Text            = dso.Checker;
            this.textBox1.Text           = IsUnChecked? dso.ReceivingAddress:dso.CheckAddress;
            this.richTextBox1.Text       = dso.Memo;
            this.dateTimePicker1.Value   = this._CurrentDso.CheckTime.Date;
            this.dateTimePicker1.Enabled = IsUnChecked;
            #endregion
        }
Esempio n. 4
0
 void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (this.dataGridView2.Columns[e.ColumnIndex].Name != this.Column22.Name)
     {
         return;
     }
     if (MessageBox.Show("确定要删除该单据吗?", "提示", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
     {
         return;
     }
     Business.Models.DirectSalesModel dsm = this.dataGridView2.Rows[e.RowIndex].DataBoundItem as Business.Models.DirectSalesModel;
     Models.DirectSalesOrder          ds  = this.PharmacyDatabaseService.GetDirectSalesOrder(dsm.DirectSalesOrderId, out msg);
     if (this.PharmacyDatabaseService.DeleteDirectSalesOrder(ds.Id, out msg))
     {
         MessageBox.Show("删除成功!单号:" + ds.DocumentNumber);
         this.PharmacyDatabaseService.WriteLog(BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "删除直调单成功,单号:" + ds.DocumentNumber);
         this.ClearCurrent();
     }
     else
     {
         MessageBox.Show("删除失败!单号:" + ds.DocumentNumber);
     }
 }