Esempio n. 1
0
        /// <summary>
        /// 入库处理
        /// </summary>
        /// <param name="stove">炉号</param>
        /// <param name="num">支数</param>
        /// <param name="grd">钢种</param>
        /// <param name="std">执行标准</param>
        /// <param name="spec">规格</param>
        /// <param name="matCode">物料编码</param>
        /// <param name="area">区域</param>
        /// <param name="loc">库位</param>
        /// <param name="tier">层</param>
        /// <param name="shift">班次</param>
        /// <param name="group">班组</param>
        /// <param name="slabwhCode">仓库编码</param>
        /// <returns></returns>
        public string PutStoreHandler(string stove, int num, string grd, string std, string spec,
                                      string matCode, string area, string loc, string tier, string shift, string group, string slabwhCode)
        {
            string    result = "1";
            DataTable dt     = dal.GetPutData(stove, num, grd, std, spec, matCode, slabwhCode).Tables[0];

            try
            {
                TransactionHelper.BeginTransaction();

                if (dt == null && dt.Rows.Count == 0)
                {
                    return("0");
                }

                if (dal.AllotPutUpdateCenter(dt, slabwhCode, area, loc, tier) != num)
                {
                    TransactionHelper.RollBack();
                    return("0");
                }

                if (dal.AllotPutUpdateSlab(dt, slabwhCode, area, loc, tier, shift, group) != num)
                {
                    TransactionHelper.RollBack();
                    return("0");
                }

                DateTime time = DateTime.Now;
                foreach (DataRow item in dt.Rows)
                {
                    Mod_TSC_ALLOT_LOG model = new Mod_TSC_ALLOT_LOG();
                    model.C_STL_GRD      = grd;
                    model.C_SPEC         = spec;
                    model.C_STD_CODE     = std;
                    model.C_MAT_CODE     = matCode;
                    model.C_STOVE        = stove;
                    model.C_SLAB_MAIN_ID = item["C_SLAB_MAIN_ID"].ToString();
                    model.N_TYPE         = 2;
                    model.D_MOD_DT       = time;
                    model.C_EMP_ID       = RV.UI.UserInfo.userID;
                    if (!logDal.Add(model))
                    {
                        TransactionHelper.RollBack();
                        return("0");
                    }
                }
                TransactionHelper.Commit();
            }
            catch (Exception ex)
            {
                TransactionHelper.RollBack();
                return("0");
            }

            return(result);
        }