Example #1
0
 /// <summary>
 /// 加载
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btnLoadItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
         {
             frmLoadSlaeOrderItem frm = new frmLoadSlaeOrderItem();
             frm.NoLoadCondition = " AND SO+ItemCode+ColorName NOT IN (SELECT ISNULL(DtsSO+ItemCode+ColorName,'') FROM UV1_WO_FabricProcessDts)";
             frm.BuyFlag         = true;
             frm.ShowDialog();
             string str = string.Empty;
             if (frm.ItemID != null && frm.ItemID.Length != 0)
             {
                 //SetGridView1();// 防止一个采购单出现两个合同的数据
                 for (int i = 0; i < frm.ItemID.Length; i++)
                 {
                     if (str != string.Empty)
                     {
                         str += ",";
                     }
                     str += SysConvert.ToString(frm.ItemID[i]);
                 }
                 SetSaleOrderItem(str);
             }
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Example #2
0
        /// <summary>
        /// 加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
                {
                    //frmLoadOrder frm = new frmLoadOrder();

                    //string sql = string.Empty;
                    ////sql += " AND FormNo+ItemCode+ColorNum+ColorName NOT IN(SELECT ISNULL(OrderFormNo+ItemCode+ColorNum+ColorName,'') OrderFormNo FROM UV1_Buy_ItemBuyFormDts";
                    ////if (saveNoLoadCheckDayNum != 0)
                    ////{
                    ////    sql += " WHERE FormDate BETWEEN " + SysString.ToDBString(DateTime.Now.AddDays(0 - saveNoLoadCheckDayNum).ToString("yyyy-MM-dd")) + " AND " + SysString.ToDBString(DateTime.Now.ToString("yyyy-MM-dd"));
                    ////}
                    ////sql += ")";
                    //sql += " AND OrderStepID=" + SysString.ToDBString((int)EnumOrderStep.新单);
                    //frm.NoLoadCondition = sql;
                    //frm.CheckFlag = 1;

                    //frm.ShowDialog();
                    //string str = string.Empty;
                    //if (frm.OrderID != null && frm.OrderID.Length != 0)
                    //{
                    //    SetGridView1();// 防止一个采购单出现两个合同的数据
                    //    for (int i = 0; i < frm.OrderID.Length; i++)
                    //    {
                    //        if (str != string.Empty)
                    //        {
                    //            str += ",";
                    //        }
                    //        str += SysConvert.ToString(frm.OrderID[i]);
                    //    }
                    //    setItemNews(str);
                    //}

                    frmLoadSlaeOrderItem frm = new frmLoadSlaeOrderItem();
                    frm.NoLoadCondition = " AND SO+ItemCode+ColorName NOT IN (SELECT ISNULL(DtsSO+ItemCode+ColorName,'') FROM UV1_Buy_ItemBuyFormDts)";
                    frm.BuyFlag         = true;
                    frm.ShowDialog();
                    string str = string.Empty;
                    if (frm.ItemID != null && frm.ItemID.Length != 0)
                    {
                        SetGridView1();// 防止一个采购单出现两个合同的数据
                        for (int i = 0; i < frm.ItemID.Length; i++)
                        {
                            if (str != string.Empty)
                            {
                                str += ",";
                            }
                            str += SysConvert.ToString(frm.ItemID[i]);
                        }
                        SetSaleOrderItem(str);
                    }
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }