Ejemplo n.º 1
0
        protected override void Delete()
        {
            if (this.workHouse == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.workHouseManager.Delete(this.workHouse.WorkHouseId);
                this.workHouse = this.workHouseManager.GetNext(this.workHouse);
                if (this.workHouse == null)
                {
                    this.workHouse = this.workHouseManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

            return;
        }
 //i=0,非生產入库,1生产入库 生产入库时查询前部门转入 前部门合计等数量
 public ChoosePronoteHeaderDetailsForm(Model.WorkHouse workHouseIndepot, int i)
     : this()
 {
     this.workHouseIndepot             = workHouseIndepot;
     this.type                         = i;
     this.newChooseWorkHorse.Enabled   = false;
     this.newChooseWorkHorse.EditValue = workHouseIndepot;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 数据源改变时触发
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void bindingSourceWorkHouse_CurrentChanged_1(object sender, EventArgs e)
 {
     Model.WorkHouse workHouse = this.bindingSourceWorkHouse.Current as Model.WorkHouse;
     if (workHouse == null)
     {
         return;
     }
     this.bindingSource1.DataSource = this.proceduresManager.Select(workHouse.WorkHouseId);
 }
Ejemplo n.º 4
0
 private void Validate(Model.WorkHouse workHouse)
 {
     if (string.IsNullOrEmpty(workHouse.Workhousename))
     {
         throw new Helper.RequireValueException(Model.WorkHouse.PROPERTY_WORKHOUSENAME);
     }
     //if (string.IsNullOrEmpty(workHouse.WorkhouseCode))
     //    throw new Helper.RequireValueException(Model.WorkHouse.PROPERTY_WORKHOUSECODE);
 }
Ejemplo n.º 5
0
        public void MyClick(ref ChooseItem item)
        {
            ChooseWorkHouseFrom f = new ChooseWorkHouseFrom();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Model.WorkHouse workHouse = f.SelectedItem as Model.WorkHouse;
                item = new ChooseItem(workHouse, workHouse.Workhousename, null);
            }
        }
Ejemplo n.º 6
0
        private void bindingSourcetechonlogy_CurrentChanged(object sender, EventArgs e)
        {
            this.gridView1.OptionsBehavior.Editable = true;

            ////Model.TechonlogyHeader techonlogyHeader = this.bindingSourceTechonlogy.Current as Model.TechonlogyHeader;
            //// this.bindingSource1.DataSource = this.technologydetailsManager.Select(techonlogyHeader);
            Model.WorkHouse workHouse = this.bindingSourceTechonlogy.Current as Model.WorkHouse;

            this.bindingSource1.DataSource = this.proceduresManager.Select(workHouse.WorkHouseId);
        }
Ejemplo n.º 7
0
        protected override void MoveNext()
        {
            Model.WorkHouse workHouse = this.workHouseManager.GetNext(this.workHouse);
            if (workHouse == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this.workHouse = workHouse;
        }
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            DateTime startTime = global::Helper.DateTimeParse.NullDate;
            DateTime endTime   = global::Helper.DateTimeParse.EndDate;

            if (this.dateEditStartDate.EditValue != null)
            {
                startTime = this.dateEditStartDate.DateTime;
            }
            if (this.dateEditEndDate.EditValue != null)
            {
                endTime = this.dateEditEndDate.DateTime;
            }

            if (type == 0) //质检
            {
                DetailList = this.pronoteHeaderManager.GetByDateZJ(startTime, endTime, this.newChooseCustomer.EditValue as Model.Customer, this.textEditCusXOId.Text, this.buttonEditPro1.EditValue as Model.Product, null, null, -1, this.workHouseIndepot == null ? null : this.workHouseIndepot.WorkHouseId, this.checkEdit1.Checked, this.TXTproNameKey.Text, this.TXTproCusNameKey.Text, this.txtpronoteHeaderIdKey.Text, this.checkEditZizhi.Checked, this.checkEditZizhiZZ.Checked, this.checkEditZizhiBCP.Checked);
            }
            else if (type == 1) //生产入库
            {
                DetailList = this.pronoteHeaderManager.GetByDate(startTime, endTime, this.newChooseCustomer.EditValue as Model.Customer, this.textEditCusXOId.Text, this.buttonEditPro1.EditValue as Model.Product, null, null, -1, this.workHouseIndepot == null ? null : this.workHouseIndepot.WorkHouseId, this.checkEdit1.Checked, this.TXTproNameKey.Text, this.TXTproCusNameKey.Text, this.txtpronoteHeaderIdKey.Text, this.checkEditZizhi.Checked, this.checkEditZizhiZZ.Checked, this.checkEditZizhiBCP.Checked);
            }
            else
            {
                this.workHouseIndepot = this.newChooseWorkHorse.EditValue as Model.WorkHouse;
                DetailList            = this.pronoteHeaderManager.GetByDateMa(startTime, endTime, this.newChooseCustomer.EditValue as Model.Customer, this.textEditCusXOId.Text, this.buttonEditPro1.EditValue as Model.Product, null, null, -1, this.workHouseIndepot == null ? null : this.workHouseIndepot.WorkHouseId, this.checkEdit1.Checked, this.TXTproNameKey.Text, this.TXTproCusNameKey.Text, this.txtpronoteHeaderIdKey.Text, this.checkEditZizhi.Checked, this.checkEditZizhiZZ.Checked, this.checkEditZizhiBCP.Checked, null);
            }


            if (DetailList != null)
            {
                int flag = 0;
                for (int i = 0; i < _pronoteHeaderList.Count; i++)
                {
                    foreach (Model.PronoteHeader detail in DetailList)
                    {
                        if (_pronoteHeaderList[i].PronoteHeaderID == detail.PronoteHeaderID)
                        {
                            detail.Checkeds = true;
                            flag            = 1;
                            break;
                        }
                    }
                    if (flag == 1)
                    {
                        break;
                    }
                }
            }
            this.bindingSource1.DataSource = DetailList;
        }
Ejemplo n.º 9
0
 public void MyLeave(ref ChooseItem item)
 {
     BL.WorkHouseManager manager   = new Book.BL.WorkHouseManager();
     Model.WorkHouse     WorkHouse = manager.Get(obj.WorkHouseId);
     if (WorkHouse != null)
     {
         item.EditValue = WorkHouse;
         item.LabelText = null;
     }
     else
     {
         item.ErrorMessage = "生產站出错";
     }
 }
Ejemplo n.º 10
0
        private void gridView1_Click(object sender, EventArgs e)
        {
            GridView    view    = sender as GridView;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Cursor.Position));

            if (hitInfo.InRow && !view.IsGroupRow(hitInfo.RowHandle))
            {
                Model.WorkHouse workHouse = this.bindingSource1.Current as Model.WorkHouse;
                if (workHouse != null)
                {
                    this.workHouse = workHouse;
                    this.action    = "view";
                    this.Refresh();
                }
            }
        }
        private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        {
            if (e.ListSourceRowIndex < 0)
            {
                return;
            }
            IList <Model.ProduceOtherMaterial> list = this.bindingSourceProduceOtherMaterial.DataSource as IList <Model.ProduceOtherMaterial>;

            if (list == null || list.Count == 0)
            {
                return;
            }
            Model.Employee  employee0 = list[e.ListSourceRowIndex].Employee0;
            Model.Employee  employee1 = list[e.ListSourceRowIndex].Employee1;
            Model.WorkHouse workHouse = list[e.ListSourceRowIndex].WorkHouse;
            Model.Depot     depot     = list[e.ListSourceRowIndex].Depot;
            switch (e.Column.Name)
            {
            case "gridColumnDepot":
                if (depot != null)
                {
                    e.DisplayText = string.IsNullOrEmpty(depot.DepotId) ? "" : depot.ToString();
                }
                break;

            case "gridColumnEmployee0Id":
                if (employee0 != null)
                {
                    e.DisplayText = string.IsNullOrEmpty(employee0.EmployeeId) ? "" : employee0.ToString();
                }
                break;

            case "gridColumnWorkHouseId":
                if (workHouse != null)
                {
                    e.DisplayText = string.IsNullOrEmpty(workHouse.WorkHouseId) ? "" : workHouse.ToString();
                }
                break;

            case "gridColumnEmployee1Id":
                if (employee1 != null)
                {
                    e.DisplayText = string.IsNullOrEmpty(employee1.EmployeeId) ? "" : employee1.ToString();
                }
                break;
            }
        }
Ejemplo n.º 12
0
 private void TiGuiExists(Model.WorkHouse model)
 {
     if (this.ExistsWorkHouseCode(model.WorkhouseCode))
     {
         //设置KEY值
         string invoiceKind   = this.GetInvoiceKind().ToLower();
         string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, model.InsertTime.Value.Year);
         string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, model.InsertTime.Value.Year, model.InsertTime.Value.Month);
         string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd"));
         string sequencekey   = string.Format(invoiceKind);
         SequenceManager.Increment(sequencekey_y);
         SequenceManager.Increment(sequencekey_m);
         SequenceManager.Increment(sequencekey_d);
         SequenceManager.Increment(sequencekey);
         model.WorkhouseCode = this.GetId(model.InsertTime.Value);
         TiGuiExists(model);
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// tree节点光标改变时触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            if (flag1 == 0)
            {
                if (e.Node != null && e.Node.ParentNode == null)
                {
                    this.textProcedureid.Text = "";
                    // this.textProcedurename.Text = "";
                    this.comboBoxProceduresate.EditValue = "";
                    // this.textProcedureType.Text = "";
                    //this.dateStartdate.EditValue = "";
                    // this.dateEnddate.EditValue = "";
                    //this.calcLeadtime.EditValue = "";
                    this.textEditDescription.Text = "";
                    this.richTextBoxName.Text     = "";
                    //this.lookUpEditProcessCate.EditValue = null;

                    flag = 1;

                    this.WorkHouse = workHouseManager.Get(e.Node.Tag.ToString());
                    if (WorkHouse != null)
                    {
                        this.textWorkhouseid.EditValue = WorkHouse;
                    }
                    this.action = "insert";
                    this.Refresh();
                }

                if (e.Node != null && e.Node.ParentNode != null)
                {
                    Model.Procedures procedures = this.proceduresManager.Get(e.Node.Tag.ToString());
                    if (procedures != null)
                    {
                        this.procedures = procedures;
                        this.action     = "view";
                        this.Refresh();
                    }
                }

                flag = 0;
            }
        }
Ejemplo n.º 14
0
        public void Insert(Model.WorkHouse workHouse)
        {
            Validate(workHouse);
            workHouse.InsertTime  = DateTime.Now;
            workHouse.UpdateTime  = DateTime.Now;
            workHouse.WorkHouseId = Guid.NewGuid().ToString();

            TiGuiExists(workHouse);

            string invoiceKind   = this.GetInvoiceKind().ToLower();
            string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, workHouse.InsertTime.Value.Year);
            string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, workHouse.InsertTime.Value.Year, workHouse.InsertTime.Value.Month);
            string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, workHouse.InsertTime.Value.ToString("yyyy-MM-dd"));
            string sequencekey   = string.Format(invoiceKind);

            SequenceManager.Increment(sequencekey_y);
            SequenceManager.Increment(sequencekey_m);
            SequenceManager.Increment(sequencekey_d);
            SequenceManager.Increment(sequencekey);

            accessor.Insert(workHouse);
        }
Ejemplo n.º 15
0
 public bool HasRowsAfter(Model.WorkHouse e)
 {
     return(sqlmapper.QueryForObject <bool>("WorkHouse.has_rows_after", e));
 }
Ejemplo n.º 16
0
 public bool HasRowsBefore(Model.WorkHouse e)
 {
     return(sqlmapper.QueryForObject <bool>("WorkHouse.has_rows_before", e));
 }
Ejemplo n.º 17
0
 public void Update(Model.WorkHouse e)
 {
     this.Update <Model.WorkHouse>(e);
 }
Ejemplo n.º 18
0
 public void Insert(Model.WorkHouse e)
 {
     this.Insert <Model.WorkHouse>(e);
 }
Ejemplo n.º 19
0
 public bool HasRowsAfter(Model.WorkHouse e)
 {
     return(accessor.HasRowsAfter(e));
 }
Ejemplo n.º 20
0
 public void Update(Model.WorkHouse workHouse)
 {
     Validate(workHouse);
     workHouse.UpdateTime = DateTime.Now;
     accessor.Update(workHouse);
 }
Ejemplo n.º 21
0
 public IList <Book.Model.ProduceInDepotDetail> SelectList(string startPronoteHeader, string endPronoteHeader, DateTime startDate, DateTime endDate, Model.Product product, Model.WorkHouse work, Model.Depot mDepot, Model.DepotPosition mDepotPosition, string id1, string id2, string cusxoid, Model.Customer customer1, Model.Customer customer2, int ProductState, string handBookId)
 {
     return(accessor.SelectList(startPronoteHeader, endPronoteHeader, startDate, endDate, product, work, mDepot, mDepotPosition, id1, id2, cusxoid, customer1, customer2, ProductState, handBookId));
 }
Ejemplo n.º 22
0
 public Model.WorkHouse GetPrev(Model.WorkHouse e)
 {
     return(accessor.GetPrev(e));
 }
Ejemplo n.º 23
0
 public Model.WorkHouse GetNext(Model.WorkHouse e)
 {
     return(accessor.GetNext(e));
 }
Ejemplo n.º 24
0
 public Model.WorkHouse GetNext(Model.WorkHouse e)
 {
     return(sqlmapper.QueryForObject <Model.WorkHouse>("WorkHouse.get_next", e));
 }
Ejemplo n.º 25
0
 public EditForm(Model.WorkHouse workHouse)
     : this()
 {
     this.workHouse = workHouse;
     this.action    = "update";
 }
Ejemplo n.º 26
0
 protected override void MoveLast()
 {
     this.workHouse = this.workHouseManager.GetLast();
 }
Ejemplo n.º 27
0
 public Model.WorkHouse GetPrev(Model.WorkHouse e)
 {
     return(sqlmapper.QueryForObject <Model.WorkHouse>("WorkHouse.get_prev", e));
 }
Ejemplo n.º 28
0
 protected override void AddNew()
 {
     this.workHouse = new Model.WorkHouse();
     this.workHouse.WorkhouseCode = workHouseManager.GetId();
 }
Ejemplo n.º 29
0
 public EditForm(Model.WorkHouse workHouse, string action)
     : this()
 {
     this.workHouse = workHouse;
     this.action    = action;
 }
Ejemplo n.º 30
0
 //商品不良率统计(2012年12月10日16:06:48没有调用过)
 public DataTable PTSelect_ChooseDefectRateCls(DateTime StartDate, DateTime EndDate, string StartProduceInDepotId, string EndProduceInDepotId, Model.Product StartProduct, Model.Product EndProduct, string StartPronoteHeaderId, string EndPronoteHeaderId, Model.WorkHouse StartWorkHouse, Model.WorkHouse EndWorkHouse, Model.Customer StartCustomer, Model.Customer EndCustomer, bool attrJiLuFangShi, bool attrQiangHua, bool attrWuDu, bool attrWuQiangHuaWuDu, int attrProductStates, double RejectionRate, string RejectionRateCompare, bool EnableBLV, int attrOrderColumn, int attrOrderType)
 {
     return(accessor.PTSelect_ChooseDefectRateCls(StartDate, EndDate, StartProduceInDepotId, EndProduceInDepotId, StartProduct, EndProduct, StartPronoteHeaderId, EndPronoteHeaderId, StartWorkHouse, EndWorkHouse, StartCustomer, EndCustomer, attrJiLuFangShi, attrQiangHua, attrWuDu, attrWuQiangHuaWuDu, attrProductStates, RejectionRate, RejectionRateCompare, EnableBLV, attrOrderColumn, attrOrderType));
 }