Example #1
0
        /// <summary>
        /// 主表保存
        /// </summary>
        /// <returns></returns>
        public string TAKEN10Edit()
        {
            string _takein_id = tbxTAKEIN_ID.Text;

            try
            {
                var    model    = new TAKEIN10(x => x.TAKEIN_ID == _takein_id);
                var    OlUser   = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                string _SHOP_ID = ddlSHOP_NAME.SelectedValue;
                if (String.IsNullOrEmpty(_takein_id))
                {
                    model.SetIsNew(true);
                    model.CRT_DATETIME = DateTime.Now;
                    model.CRT_USER_ID  = OlUser.Manager_LoginName;
                    DataTable dt = new DataTable();
                    dt         = (DataTable)SPs.Get_ORDER_SEED(_SHOP_ID, "TAKEN10").ExecuteDataTable();
                    _takein_id = dt.Rows[0]["PLANE_ID"].ToString();
                    //var model = Purchase00.SingleOrDefault(x => x.Purchase_ID == _Pur00_id);
                }
                model.SHOP_ID   = _SHOP_ID;
                model.TAKEIN_ID = _takein_id.ToString();
                model.STATUS    = ConvertHelper.Cint(ddlStatus.SelectedValue);
                model.STOCK_ID  = ddlSTOCK_ID.SelectedValue;
                //model.INPUT_DATE = ConvertHelper.StringToDatetime(dpINPUT_DATE.SelectedDate.ToString());
                model.INPUT_DATE   = ConvertHelper.StringToDatetime(dpINPUT_DATE.SelectedDate.ToString());
                model.SUP_ID       = ddlSUP_NAME.SelectedValue;
                model.USER_ID      = OlUser.Manager_LoginName;
                model.APP_USER     = OlUser.Manager_LoginName;
                model.APP_DATETIME = DateTime.Now;
                model.TOT_AMOUNT   = ConvertHelper.StringToDecimal(numTOT_AMOUNT.Text);
                model.TOT_TAX      = ConvertHelper.StringToDecimal(numTOT_QTY.Text);
                model.TOT_QTY      = ConvertHelper.StringToDecimal(numPRE_PAY.Text);
                model.PRE_PAY      = ConvertHelper.StringToDecimal(numPRE_PAY.Text);
                model.PRE_PAY_ID   = tbxPRE_PAY_ID.Text;
                model.RELATE_ID    = tbxRELATE_ID.Text;
                model.INVOICE_ID   = tbxINVOICE_ID.Text;
                model.TAKEIN_TYPE  = ConvertHelper.Cint(ddlTAKEIN_TYPE.SelectedValue);
                model.Memo         = tbxMemo.Text;
                model.LOCKED       = ConvertHelper.StringToByte(ckLOCKED.Checked ? "1" : "0");
                model.MOD_DATETIME = DateTime.Now;
                model.MOD_USER_ID  = OlUser.Manager_LoginName;
                model.LAST_UPDATE  = DateTime.Now;
                model.Trans_STATUS = 0;
                TAKEIN10Bll.GetInstence().Save(this, model);
            }
            catch (Exception err)
            {
                return(err.Message);
            }
            return("");
        }
Example #2
0
        /// <summary>
        /// 主表保存
        /// </summary>
        /// <returns></returns>
        public string MAINEdit()
        {
            string _TAKEIN_ID = tbxTAKEIN_ID.Text;

            try
            {
                var    model    = new TAKEIN10(x => x.TAKEIN_ID == _TAKEIN_ID);
                var    OlUser   = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                string _SHOP_ID = ddlSHOP_NAME.SelectedValue;
                if (String.IsNullOrEmpty(_TAKEIN_ID))
                {
                    model.SetIsNew(true);
                    model.CRT_DATETIME = DateTime.Now;
                    model.CRT_USER_ID  = OlUser.Manager_LoginName;
                    DataTable dt = new DataTable();
                    dt                = (DataTable)SPs.Get_ORDER_SEED(_SHOP_ID, "TAKEIN10").ExecuteDataTable();
                    _TAKEIN_ID        = dt.Rows[0]["PLANE_ID"].ToString();
                    tbxTAKEIN_ID.Text = _TAKEIN_ID;
                    //var model = Purchase00.SingleOrDefault(x => x.Purchase_ID == _Pur00_id);
                }
                model.SHOP_ID    = _SHOP_ID;
                model.TAKEIN_ID  = _TAKEIN_ID.ToString();
                model.STATUS     = ConvertHelper.Cint(ddlStatus.SelectedValue);
                model.INPUT_DATE = ConvertHelper.StringToDatetime(dpINPUT_DATE.SelectedDate.ToString());
                if (String.IsNullOrEmpty(ddlSUP_ID.SelectedValue))
                {
                    model.SUP_ID = "";
                }
                else
                {
                    model.SUP_ID = ddlSUP_ID.SelectedValue;
                }

                model.STOCK_ID     = ddlSTOCK_ID.SelectedValue;
                model.USER_ID      = OlUser.Manager_LoginName;
                model.APP_USER     = OlUser.Manager_LoginName;
                model.APP_DATETIME = tbxAPP_DATETIME.Text == "" ? DateTime.Parse("1900-01-01 00:00:00") : DateTime.Now;

                string _RELATE_ID = tbxRELATE_ID.Text;
                model.RELATE_ID = _RELATE_ID;
                //if (!String.IsNullOrEmpty(_RELATE_ID))
                //{
                //    var modelOrder = new OUT_BACK00(x => x.BK_ID == _RELATE_ID);
                //    modelOrder.Exported = 1;
                //    modelOrder.Exported_ID = _TAKEIN_ID;
                //    modelOrder.Save();
                //}
                model.Memo   = tbxMemo.Text;
                model.LOCKED = ConvertHelper.StringToByte(ckLOCKED.Checked ? "1" : "0");

                model.MOD_DATETIME = DateTime.Now;
                model.MOD_USER_ID  = OlUser.Manager_LoginName;
                model.LAST_UPDATE  = DateTime.Now;
                model.Trans_STATUS = 0;
                TAKEIN10Bll.GetInstence().Save(this, model);
                LoadMAIN();
            }
            catch (Exception err)
            {
                return(err.Message);
            }
            return("");
        }