Exemplo n.º 1
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="p_FormID">单据ID</param>
        /// <param name="p_Type">0/1/2/3:弃审/审核</param>
        public void RSubmit(int p_FormID, int p_Type, IDBTransAccess sqlTrans)
        {
            try
            {
                int             p_TempType = p_Type;//处理状态
                string          sql        = string.Empty;
                FabricWHOutForm entity     = new FabricWHOutForm(sqlTrans);
                entity.ID = p_FormID;
                entity.SelectByID();


                if (entity.SubmitFlag == p_Type)//如果相同异常
                {
                    throw new Exception("单据状态重复设置,请关闭程序重新打开操作");
                }

                IOForm entitywh = new IOForm();
                if (p_Type == (int)YesOrNo.Yes)
                {
                    /*创建自动出库单并提交*/
                    entitywh = RAutoCreateWHForm(entity, sqlTrans);
                }
                else
                {
                    /*撤销提交自动出库单并删除*/
                    RAutoDeleteWHForm(entity, sqlTrans);
                }

                /* 更新扣料单据状态*/
                sql = "UPDATE WO_FabricWHOutForm SET SubmitFlag=" + SysString.ToDBString(p_Type);
                //if (p_Type == (int)ConfirmFlag.审核通过 || p_Type == (int)ConfirmFlag.审核拒绝)
                //{
                //    //sql += ",SubmitOPID=" + SysString.ToDBString(ParamConfig.LoginName) + ",SubmitTime=" + SysString.ToDBString(DateTime.Now);
                //}
                sql += ",AutoIOFormID=" + entitywh.ID;
                sql += ",AutoIOFormNo=" + SysString.ToDBString(entitywh.FormNo);
                sql += " WHERE ID=" + p_FormID.ToString();//更新单据主表审核状态
                sqlTrans.ExecuteNonQuery(sql);

                /*更新加工单据扣料状态*/
                sql  = "UPDATE WO_FabricProcess SET WHOutFormFlag=" + SysString.ToDBString(p_Type);
                sql += " WHERE ID=" + entity.MainID.ToString();//更新单据主表审核状态
                sqlTrans.ExecuteNonQuery(sql);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private FabricWHOutForm EntityGet()
        {
            FabricWHOutForm entity = new FabricWHOutForm();

            entity.ID = HTDataID;
            entity.SelectByID();
            entity.MainID   = m_MainID;
            entity.FormNo   = txtFormNo.Text.Trim();
            entity.MakeDate = txtFormDate.DateTime;
            //entity.VendorID = drpVendorID.EditValue.ToString();
            //entity.Remark = txtRemark.Text.Trim();
            entity.WHID       = SysConvert.ToString(drpWHID.EditValue);
            entity.MakeOPName = FParamConfig.LoginName;

            return(entity);
        }