Example #1
0
 /// <summary>
 /// Create a new tinpsupplementdtl object.
 /// </summary>
 /// <param name="supldtlsysid">Initial value of the supldtlsysid property.</param>
 public static tinpsupplementdtl Createtinpsupplementdtl(global::System.String supldtlsysid)
 {
     tinpsupplementdtl tinpsupplementdtl = new tinpsupplementdtl();
     tinpsupplementdtl.supldtlsysid = supldtlsysid;
     return tinpsupplementdtl;
 }
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tinpsupplementdtl EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotinpsupplementdtl(tinpsupplementdtl tinpsupplementdtl)
 {
     base.AddObject("tinpsupplementdtl", tinpsupplementdtl);
 }
Example #3
0
        private void DoSupplement()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                baseForm.ValidateData(this);

                if (!isExistOrder(((ValueInfo)this.cmbCustomer.SelectedItem).ValueField,this.txtCustOrderNo.Text))
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01021", this.txtCustOrderNo.Text));
                }

                tinpsupplement supplement = new tinpsupplement();
                supplement.suplsysid = Function.GetGUID();
                supplement.supplementno = this.txtSupplementNo.Text;
                supplement.customerid = ((ValueInfo)this.cmbCustomer.SelectedItem).ValueField;
                supplement.custorderno = this.txtCustOrderNo.Text;
                supplement.step = ((ValueInfo)this.cmbStep.SelectedItem).ValueField;
                supplement.workgroup = ((ValueInfo)this.cmbWorkGroup.SelectedItem).ValueField;
                supplement.factory = this.txtFactory.Text;
                supplement.supplementdate = Function.GetCurrentTime();
                supplement.supplementuser = Function.GetCurrentUser();
                supplement.lastmodifiedtime = Function.GetCurrentTime();
                supplement.lastmodifieduser = Function.GetCurrentUser();

                List<tinpsupplementdtl> lstsupplementdtl = new List<tinpsupplementdtl>();

                foreach (UltraGridRow row in this.grdDetail.Rows)
                {
                    if (row.Cells["styleno"].Value.ToString().Equals(string.Empty))
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01026")));
                    }
                    if (row.Cells["color"].Value.ToString().Equals(string.Empty))
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01027")));
                    }
                    if (row.Cells["size"].Value.ToString().Equals(string.Empty))
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01028")));
                    }
                    if (Convert.ToInt16(row.Cells["pairqty"].Value) == 0)
                    {
                        throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02026")));
                    }

                    tinpsupplementdtl supplementdtl = new tinpsupplementdtl();
                    supplementdtl.supldtlsysid = Function.GetGUID();
                    supplementdtl.suplsysid = supplement.suplsysid;
                    supplementdtl.customerid = ((ValueInfo)this.cmbCustomer.SelectedItem).ValueField;
                    supplementdtl.custorderno = supplement.custorderno;
                    supplementdtl.styleno = row.Cells["styleno"].Value.ToString();
                    supplementdtl.color = row.Cells["color"].Value.ToString();
                    supplementdtl.size = row.Cells["size"].Value.ToString();
                    supplementdtl.checktype = row.Cells["checktype"].Value.ToString();
                    supplementdtl.pairqty = Convert.ToInt16(row.Cells["pairqty"].Value);
                    supplementdtl.isreinspect = row.Cells["isreinspect"].Value.ToString();
                    lstsupplementdtl.Add(supplementdtl);
                }

                if (lstsupplementdtl.Count == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01019"));
                }

                client.DoSupplement(baseForm.CurrentContextInfo, supplement, lstsupplementdtl.ToArray<tinpsupplementdtl>());
                baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));
                this.Close();

            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }