Ejemplo n.º 1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public void RSave(int p_ID, int p_MainID, int p_Seq, BaseEntity[] p_BE, bool p_UpdateFlag)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RSave(p_ID, p_MainID, p_Seq, p_BE, p_UpdateFlag, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 保存资金明细
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public void RSaveBuyCap(ItemBuyForm p_BEMain)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RSaveBuyCap(p_BEMain, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="p_FormID">单据ID</param>
        /// <param name="p_Type">0/1:弃审/审核</param>
        public void RSubmit(int p_FormID, int p_Type)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RSubmit(p_FormID, p_Type, sqlTrans);
                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 扫描数据
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public void RScanCancel(int p_ID, string p_ISN)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RScanCancel(p_ID, p_ISN, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_TableName"></param>
        /// <param name="p_TableID"></param>
        /// <param name="p_Val"></param>
        public void RDelete(string p_TableName, int p_TableID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RDelete(p_TableName, p_TableID, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 撤销核销处理
        /// </summary>
        public void RHXCancel(InvoiceOperation entity, int p_DtsID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RHXCancel(entity, p_DtsID, sqlTrans);
                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_BE">要修改的实体</param>
        public void RUpdate(string p_GBCode, int p_SubmitFlag, int p_MainID, int LYFlag, string p_OPID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RUpdate(p_GBCode, p_SubmitFlag, p_MainID, LYFlag, p_OPID, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 8
0
        public void RDelLR(int HTDataID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RDelLR(HTDataID, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 新增
        /// </summary>
        public int RAdd(byte[] p_File, int winListID, int headtype, int subtype, int dataid, int dataSeq, string fileName, string filetitle, string fileExec, string p_Remark, string p_FileProt1, string p_FileProt2, decimal fileSize, string LoginID, string LoginName, int loginLogID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess(SystemConfiguration.ConnectionString);
                try
                {
                    sqlTrans.OpenTrans();

                    int outid = RAdd(p_File, winListID, headtype, subtype, dataid, dataSeq, fileName, filetitle, fileExec, p_Remark, p_FileProt1, p_FileProt2, fileSize, LoginID, LoginName, loginLogID, sqlTrans);

                    sqlTrans.CommitTrans();

                    return(outid);
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public void RAdd(int p_ID, decimal p_Qty, string p_OPID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RAdd(p_ID, p_Qty, p_OPID, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 扫描数据
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public int RScan(int p_ID, string p_ISN, int p_YPQty, string p_Vendorid, int p_ZHID, DateTime p_Time)
        {
            int outi = 0;

            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    outi = this.RScan(p_ID, p_ISN, p_YPQty, p_Vendorid, p_ZHID, p_Time, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
            return(outi);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public void RAdd(BaseEntity p_BE, BaseEntity[] p_BE2)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RAdd(p_BE, p_BE2, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="p_BE"></param>
        /// <param name="p_BESub"></param>
        public void RSave(BaseEntity[] p_BE, BaseEntity[] p_BESub, string p_AuthGrpID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    this.RSave(p_BE, p_BESub, p_AuthGrpID, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 扫描数据 确认完成
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        public int RScanOK(int p_ID)
        {
            int outi = 0;

            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();

                    outi = this.RScanOK(p_ID, sqlTrans);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
            return(outi);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 删除库存0的数据--没有交易记录的
        /// </summary>
        /// <param name="entity"></param>
        public void DeleteZeroIOForm(Storge entity)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    sqlTrans.OpenTrans();
                    string sql = "Delete From WH_STORGE  WHERE ID =" + entity.ID;
                    sqlTrans.ExecuteNonQuery(sql);

                    sql = "Delete From  WH_IOFormLedger WHERE 1=1";

                    sql += " AND isnull(ColorNum,'')=" + SysString.ToDBString(entity.ColorNum);
                    sql += " AND isnull(ColorName,'')=" + SysString.ToDBString(entity.ColorName);
                    sql += " AND isnull(Batch,'')=" + SysString.ToDBString(entity.Batch);
                    sql += " AND isnull(VendorBatch,'')=" + SysString.ToDBString(entity.VendorBatch);
                    sql += " AND isnull(JarNum,'')=" + SysString.ToDBString(entity.JarNum);
                    //sql += " AND isnull(SizeName,'')=" + SysString.ToDBString(entity.SizeName);
                    sql += " AND isnull(ItemCode,'')=" + SysString.ToDBString(entity.ItemCode);
                    //sql += " AND isnull(YarnStatus,'')=" + SysString.ToDBString(entity.YarnStatus);
                    sql += " AND isnull(WHID,'')=" + SysString.ToDBString(entity.WHID);

                    sqlTrans.ExecuteNonQuery(sql);

                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// ±£´æ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();

                try
                {
                    sqlTrans.OpenTrans();

                    string[] listm_GBCode = m_GBCode.Split(new char[1] {
                        ','
                    });
                    for (int i = 0; i < listm_GBCode.Length; i++)
                    {
                        string sql = "UPDATE Data_ItemGB SET XY=" + SysConvert.ToInt32(drpXY.EditValue);
                        sql += ",XYDesc=" + SysString.ToDBString(txtXYDesc.Text.Trim());
                        sql += ",GBDesc=" + SysString.ToDBString(txtGBDesc.Text.Trim());
                        sql += ",Remark=" + SysString.ToDBString(txtDRemark.Text.Trim());
                        sql += " WHERE GBCode=" + SysString.ToDBString(listm_GBCode[i]);
                        sqlTrans.ExecuteNonQuery(sql);
                    }
                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }


                this.Close();
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 装箱
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPack_Click(object sender, EventArgs e)
        {
            string    sql    = "SELECT * FROM WO_ISNTemp WHERE Status=1 ORDER BY Sort ASC ";
            DataTable dt     = SysUtils.Fill(sql);//读取待装箱数据
            DataTable dttemp = new DataTable();

            if (CheckISNRule(dt, out dttemp))//条码校验合格后插入包装表中
            {
                try
                {
                    IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                    try
                    {
                        sqlTrans.OpenTrans();

                        InsertPackISN(dttemp, sqlTrans);

                        sqlTrans.CommitTrans();
                    }
                    catch (Exception TE)
                    {
                        sqlTrans.RollbackTrans();
                        throw TE;
                    }
                }
                catch (BaseException)
                {
                    throw;
                }
                catch (Exception E)
                {
                    throw new BaseException(E.Message);
                }
            }

            BindScanISN();
            BindPack();
        }
Ejemplo n.º 18
0
 /// <summary>
 /// 插入读出的条码
 /// </summary>
 /// <param name="ScanISN"></param>
 private void InsertISN(List <string> ScanISN)
 {
     try
     {
         IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
         try
         {
             sqlTrans.OpenTrans();
             ISNTempRule rule  = new ISNTempRule();
             int         index = 1;
             foreach (string ISN in ScanISN)
             {
                 ISNTemp entity = new ISNTemp(sqlTrans);
                 entity.ISN        = ISN;
                 entity.Status     = 1;
                 entity.Sort       = index;
                 entity.ImportTime = DateTime.Now;
                 rule.RAdd(entity, sqlTrans);
                 index++;
             }
             sqlTrans.CommitTrans();
         }
         catch (Exception TE)
         {
             sqlTrans.RollbackTrans();
             throw TE;
         }
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Ejemplo n.º 19
0
        /// <summary>
        ///  获得单据号码(通过单号关系表)
        /// </summary>
        /// <param name="p_ClsA"></param>
        /// <param name="p_ClsB"></param>
        /// <param name="p_DepID">部门</param>
        /// <returns></returns>
        public string RGetFormNo(string p_ClsA, string p_ClsB, int p_DepID)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();
                try
                {
                    string outstr = string.Empty;
                    sqlTrans.OpenTrans();

                    string    sql = "SELECT FormNoControlID FROM Data_FNORel WHERE CLSA=" + SysString.ToDBString(p_ClsA) + " AND CLSB=" + SysString.ToDBString(p_ClsB);
                    DataTable dt  = sqlTrans.Fill(sql);
                    if (dt.Rows.Count != 0)
                    {
                        outstr = this.RGetFormNo(SysConvert.ToInt32(dt.Rows[0]["FormNoControlID"]), sqlTrans);
                    }

                    sqlTrans.CommitTrans();

                    return(outstr);
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                IDBTransAccess sqlTrans = TransSysUtils.GetDBTransAccess();

                try
                {
                    sqlTrans.OpenTrans();
                    bool   flag = false;
                    string sql  = "Select * from Dev_GBJCDts where 1= 1";
                    if (GBCode != string.Empty)
                    {
                        sql += " AND " + GBCode;
                    }
                    DataTable dtDev = sqlTrans.Fill(sql);
                    for (int i = 0; i < dtDev.Rows.Count; i++)
                    {
                        string   VendorIDStr   = SysConvert.ToString(dtDev.Rows[i]["JYVendorID"]);
                        string   VendorNameStr = SysConvert.ToString(dtDev.Rows[i]["JYVendorName"]);
                        string[] vendorid      = VendorIDStr.Split(',');
                        if (SysConvert.ToString(dtDev.Rows[i]["JYVendorID"]) == "")
                        {
                            VendorIDStr = SysConvert.ToString(drpVendorID.EditValue);
                            sql         = "Select VendorAttn from Data_Vendor where VendorID = " + SysString.ToDBString(SysConvert.ToString(drpVendorID.EditValue));
                            DataTable dt = sqlTrans.Fill(sql);
                            if (dt.Rows.Count == 1)
                            {
                                VendorNameStr = SysConvert.ToString(dt.Rows[0]["VendorAttn"]);
                            }
                        }
                        else
                        {
                            sql = "Select VendorAttn from Data_Vendor where VendorID = " + SysString.ToDBString(SysConvert.ToString(drpVendorID.EditValue));
                            DataTable dt = sqlTrans.Fill(sql);
                            if (vendorid.Length > 0)
                            {
                                for (int j = 0; j < vendorid.Length; j++)
                                {
                                    if (vendorid[j].ToString() == SysConvert.ToString(drpVendorID.EditValue))
                                    {
                                        flag = true;
                                        break;
                                    }
                                }
                            }
                            if (!flag)
                            {
                                if (dt.Rows.Count == 1)
                                {
                                    VendorNameStr += "," + SysConvert.ToString(dt.Rows[0]["VendorAttn"]);
                                }
                                VendorIDStr += "," + SysConvert.ToString(drpVendorID.EditValue);
                            }
                        }

                        sql  = "UPDATE Dev_GBJCDts SET JYVendorID= " + SysString.ToDBString(VendorIDStr);
                        sql += ",JYVendorName = " + SysString.ToDBString(VendorNameStr);
                        //sql += ",LYFlag = 1";
                        sql += " WHERE MainID =" + SysConvert.ToString(dtDev.Rows[i]["MainID"]);
                        sql += " AND Seq = " + SysConvert.ToString(dtDev.Rows[i]["Seq"]);
                        sqlTrans.ExecuteNonQuery(sql);
                    }
                    sqlTrans.CommitTrans();
                }
                catch (Exception TE)
                {
                    sqlTrans.RollbackTrans();
                    throw TE;
                }


                this.Close();
            }
            catch (Exception E)
            {
            }
        }