/// <summary>
 /// 加载
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtOrderFormNo_DoubleClick(object sender, EventArgs e)
 {
     if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
     {
         frmLoadItemBuy frm = new frmLoadItemBuy();
         string         sql = "";
         //sql += " AND FormNo NOT IN (SELECT BuyFormNo FROM Buy_ItemBuyFollow";
         sql += " AND DtsID NOT IN (SELECT ISNULL(DLoadDtsID,0) FROM Buy_ItemBuyFollow";
         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 += ") ";
         frm.NoLoadCondition = sql;
         frm.ShowDialog();
         string str = string.Empty;
         if (frm.ItemBuyID != null && frm.ItemBuyID.Length != 0)
         {
             if (frm.ItemBuyID.Length > 1)
             {
                 this.ShowMessage("请只选择一条采购单信息进行加载");
                 return;
             }
             for (int i = 0; i < frm.ItemBuyID.Length; i++)
             {
                 if (str != string.Empty)
                 {
                     str += ",";
                 }
                 str += SysConvert.ToString(frm.ItemBuyID[i]);
             }
             SetBuyNo(str);
         }
     }
 }
 private void restxtItemCode_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
         {
             frmLoadItemBuy frm = new frmLoadItemBuy();
             frm.VendorID = SysConvert.ToString(drpVendorID.EditValue);
             frm.ShowDialog();
             string str = string.Empty;
             if (frm.ItemBuyID != null && frm.ItemBuyID.Length != 0)
             {
                 for (int i = 0; i < frm.ItemBuyID.Length; i++)
                 {
                     if (str != string.Empty)
                     {
                         str += ",";
                     }
                     str += SysConvert.ToString(frm.ItemBuyID[i]);
                 }
                 SetGrid(str);
             }
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Example #3
0
        /// <summary>
        /// 加载采购单
        /// </summary>
        private void WHLoadItemBuyForm()
        {
            frmLoadItemBuy frm = new frmLoadItemBuy();

            frm.ShowDialog();
            string str = string.Empty;

            if (frm.ItemBuyID != null && frm.ItemBuyID.Length != 0)
            {
                for (int i = 0; i < frm.ItemBuyID.Length; i++)
                {
                    if (str != string.Empty)
                    {
                        str += ",";
                    }
                    str += SysConvert.ToString(frm.ItemBuyID[i]);
                }
                SetWH(str);
            }
        }
Example #4
0
        /// <summary>
        /// 合同检索
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHTSearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请定位主记录");
                    return;
                }
                if (HTDataSubmitFlag != (int)YesOrNo.Yes)
                {
                    this.ShowMessage("单据未提交,不能操作");
                    return;
                }

                if (SysConvert.ToInt32(drpRecPayType.EditValue) == (int)EnumRecPayType.收款)//加载销售合同
                {
                    frmLoadOrder frm = new frmLoadOrder();

                    string sql = string.Empty;
                    frm.NoLoadCondition = sql;
                    frm.VendorID        = SysConvert.ToString(drpVendorID.EditValue);

                    frm.ShowDialog();
                    string str = string.Empty;
                    if (frm.OrderID != null && frm.OrderID.Length != 0)
                    {
                        for (int i = 0; i < frm.OrderID.Length; i++)
                        {
                            if (str != string.Empty)
                            {
                                str += ",";
                            }
                            str += SysConvert.ToString(frm.OrderID[i]);
                            break;//只加载一个合同号
                        }
                        setItemNewsSaleHT(str);
                    }
                }
                else if (SysConvert.ToInt32(drpRecPayType.EditValue) == (int)EnumRecPayType.付款)//加载采购合同
                {
                    frmLoadItemBuy frm = new frmLoadItemBuy();
                    frm.VendorID = SysConvert.ToString(drpVendorID.EditValue);
                    string sql = string.Empty;

                    frm.NoLoadCondition = sql;
                    frm.ShowDialog();
                    string str = string.Empty;
                    if (frm.ItemBuyID != null && frm.ItemBuyID.Length != 0)
                    {
                        for (int i = 0; i < frm.ItemBuyID.Length; i++)
                        {
                            if (str != string.Empty)
                            {
                                str += ",";
                            }
                            str += SysConvert.ToString(frm.ItemBuyID[i]);
                            break;//只加载一个合同号
                        }
                        setItemNewsBuyHT(str);
                    }
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }