Exemplo n.º 1
0
        /// <summary>
        /// 获取当前二级库存对象
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        private OrdSecondAyplnvModel GetOrdSecondAyplnvModel(DataRow dr)
        {
            OrdSecondAyplnvModel model = new OrdSecondAyplnvModel();

            model.Stock_Item_Id      = dr["ID"].ToString();
            model.Project_Id         = dr["PROJECT_ID"].ToString();
            model.Project_Product_Id = dr["PROJECT_PROD_ID"].ToString();
            model.Data_Product_Id    = dr["DATA_PRODUCT_ID"].ToString();
            model.Buyer_Id           = base.CurrentUserOrgId;

            model.Saler_Id  = dr["SALER_ID"].ToString();
            model.Sender_Id = dr["SENDER_ID"].ToString();
            if (!dr["PBNO"].ToString().Equals("-"))
            {
                model.Pbno = dr["PBNO"].ToString();
            }
            model.Send_Batch_No    = dr["SEND_BATCH_NO"].ToString();
            model.Instore_Batch_No = dr["INSTORE_BATCH_NO"].ToString();
            model.Sender_Name      = dr["SENDER_NAME"].ToString();
            model.Spec_Id          = dr["SPEC_ID"].ToString();
            model.Model_Id         = dr["MODEL_ID"].ToString();
            model.Barcode          = dr["BARCODE"].ToString();
            model.Price            = dr["PRICE"].ToString();
            if (!dr["BATCH_NO"].ToString().Equals("-"))
            {
                model.Batch_No = dr["BATCH_NO"].ToString();
            }
            if (!dr["VALID_DATE"].ToString().Equals("-"))
            {
                model.Valid_Date = dr["VALID_DATE"].ToString();
            }
            model.Num    = dr["NUM"].ToString();
            model.Remark = dr["REMARK"].ToString();
            model.State  = dr["STATE"].ToString();;

            return(model);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 备货单确认事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAffirm_Click(object sender, EventArgs e)
        {
            //提示信息
            //if (XtraMessageBox.Show("确认是否备货单确认操作?", Constant.MsgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            //    return;

            //进行数据验证
            string strError = string.Empty;

            if (!ValiData_ByGrid(out strError))
            {
                XtraMessageBox.Show(strError, Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                //保存到二级库存表
                List <OrdSecondAyplnvModel> ListOrdSecondAyplnvModel = new List <OrdSecondAyplnvModel>();

                //获取已选择数据集
                DataTable dt = StockUpItemDt.DefaultView.ToTable();

                foreach (DataRow dr in dt.Rows)
                {
                    string strSel = dr["Sel"].ToString();

                    if (strSel.Equals("1"))
                    {
                        OrdSecondAyplnvModel model = GetOrdSecondAyplnvModel(dr);

                        ListOrdSecondAyplnvModel.Add(model);
                    }
                }
                SaveListOrdSecondAyplnvModelList(ListOrdSecondAyplnvModel);
                //----------------------------------------------------------------------------------

                //2.修改主表及明细表状态----------------------------------------------------
                List <OrdStockUpItemModel> ListOrdStockUpItemModel = new List <OrdStockUpItemModel>();
                foreach (DataRow dr in dt.Rows)
                {
                    string strSel = dr["Sel"].ToString();

                    if (strSel.Equals("1"))
                    {
                        OrdStockUpItemModel model = GetOrdStockUpItemModel(dr);

                        ListOrdStockUpItemModel.Add(model);
                    }
                }

                if (ListOrdStockUpItemModel.Count > 0)
                {
                    OrdStockUpItemBLL.GetInstance().UpdateBarcodeOrdStockUpItemList(ListOrdStockUpItemModel, strStockUpID);
                }
                //----------------------------------------------------------------------------------

                XtraMessageBox.Show("备货单确认成功!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);

                //备货单确认后刷新数据集
                RefreshData();
                //更新标题
                IniData(strStockUpID);

                EditFlag = true;

                //this.Close();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("备货单确认失败!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 保存二级库存对象
        /// </summary>
        /// <param name="HitCommID"></param>
        /// <returns></returns>
        public void SaveOrdSecondAyplnvModel(OrdSecondAyplnvModel model, LogedInUser logedinUser, DbTransaction transaction)
        {
            StringBuilder strSql = new StringBuilder();

            string strID = base.GetClientId(logedinUser.HighId).ToString();

            strSql.Append(@"Insert Into HC_ORD_SECOND_AYRLNV(
                            ID, 
                            DATA_PRODUCT_ID, 
                            STOCK_ITEM_ID,
                            PROJECT_ID, 
                            BUYER_ID, 
                            SALER_ID, 
                            SENDER_ID, 
                            SENDER_NAME,
                            PBNO,
                            SEND_BATCH_NO,
                            INSTORE_BATCH_NO, 
                            PROJECT_PRODUCT_ID, 
                            SPEC_ID, 
                            MODEL_ID, 
                            BARCODE, 
                            PRICE, 
                            BATCH_NO, 
                            VALID_DATE, 
                            NUM, 
                            REMARK, 
                            STATE, 
                            CREATE_USER_ID, 
                            CREATE_USER_NAME, 
                            CREATE_DATE, 
                            MODIFY_USER_ID, 
                            MODIFY_USER_NAME, 
                            MODIFY_DATE, 
                            SYNC_STATE
                            )");
            strSql.Append(" Values (");
            strSql.AppendFormat("'{0}',", strID);
            strSql.AppendFormat("'{0}',", model.Data_Product_Id);
            strSql.AppendFormat("'{0}',", model.Stock_Item_Id);
            strSql.AppendFormat("'{0}',", model.Project_Id);
            strSql.AppendFormat("'{0}',", model.Buyer_Id);//买方ID
            strSql.AppendFormat("'{0}',", model.Saler_Id);
            strSql.AppendFormat("'{0}',", model.Sender_Id);
            strSql.AppendFormat("'{0}',", model.Sender_Name);
            strSql.AppendFormat("'{0}',", model.Pbno);
            strSql.AppendFormat("'{0}',", model.Send_Batch_No);
            strSql.AppendFormat("'{0}',", model.Instore_Batch_No);
            strSql.AppendFormat("'{0}',", model.Project_Product_Id);
            strSql.AppendFormat("'{0}',", model.Spec_Id);
            strSql.AppendFormat("'{0}',", model.Model_Id);
            strSql.AppendFormat("'{0}',", model.Barcode);
            strSql.AppendFormat("{0},", model.Price);
            strSql.AppendFormat("'{0}',", model.Batch_No);
            strSql.AppendFormat("'{0}',", model.Valid_Date);
            strSql.AppendFormat("{0},", model.Num);
            strSql.AppendFormat("'{0}',", model.Remark);
            strSql.AppendFormat("'{0}',", "1");
            strSql.AppendFormat("'{0}',", logedinUser.UserInfo.Id);
            strSql.AppendFormat("'{0}',", logedinUser.UserInfo.Name);
            strSql.AppendFormat("'{0}',", DateTime.Now.ToString());
            strSql.AppendFormat("'{0}',", logedinUser.UserInfo.Id);
            strSql.AppendFormat("'{0}',", logedinUser.UserInfo.Name);
            strSql.AppendFormat("'{0}',", DateTime.Now.ToString());
            strSql.Append("'0'");
            strSql.Append(")");

            try
            {
                base.DbFacade.SQLExecuteNonQuery(strSql.ToString());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }