Beispiel #1
0
        /// <summary>
        ///  收发存汇总表
        /// </summary>
        /// <param name="strsql"></param>
        /// <returns></returns>
        public DataTable sp_GetInOutStorageSum(string strbegindate, string strenddate, string MaterialGuid, string StorageID, string MaterialTypeGuid, string SupplierGuid)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[6, 2];
                par[0, 0] = "@BeginDate";
                par[0, 1] = strbegindate;
                par[1, 0] = "@EndDate";
                par[1, 1] = strenddate;
                par[2, 0] = "@MaterialGuid";
                par[2, 1] = MaterialGuid;
                par[3, 0] = "@StorageID";
                par[3, 1] = StorageID;
                par[4, 0] = "@MaterialTypeGuid";
                par[4, 1] = MaterialTypeGuid;
                par[5, 0] = "@Supplier";
                par[5, 1] = SupplierGuid;


                dset = pComm.ExcuteSp("sp_GetInOutStorageSum", par);

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 得到员工所在部门
        /// </summary>
        /// <param name="EmpGuid"></param>
        public string GetEmpGuIDByEmpName(string EmpName)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string    ps_Sql = "select EmpGuid  from Employee  where  EmpName='" + EmpName + "'";
                DataTable dtl    = new DataTable();
                dtl = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (dtl.Rows.Count > 0)
                {
                    return(dtl.Rows[0]["EmpGuid"].ToString());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 更新审核状态度
        /// </summary>
        /// <returns></returns>
        public void ChcekCheckBill(string CheckBillGuid, int pass)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string ps_Sql = "";
                //删除主表
                if (pass == 1)
                {
                    //通过
                    ps_Sql = "update  CheckBill  set CheckPerson='" + SysParams.UserName + "',CheckDate='" + DateTime.Now.ToString() + "'  where  CheckBillGuid='" + CheckBillGuid + "'";
                }
                else
                {
                    //不通过
                    ps_Sql = "update  CheckBill  set CheckPerson='',CheckDate=null  where  CheckBillGuid='" + CheckBillGuid + "'";
                }

                pObj_Comm.Execute(ps_Sql);
                pObj_Comm.Close();
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 得到采购订单主表数据
        /// </summary>
        /// <param name="FatherMaterialGuid"></param>
        /// <returns></returns>
        public string GetMaterialByStockOrderDetailGuid(string StockOrderDetailGuid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = "select  MaterialGuid   from  StockOrderDetail where StockOrderDetailGuid='" + StockOrderDetailGuid + "'";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    return(pDTMain.Rows[0]["MaterialGuid"].ToString().Trim());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [Client](");
            strSql.Append("Guid,Name,SimpName,LinkMan,Telephone,Fax,Address,Zip,Remark,ProductName,SellType,IsEnable");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append("'" + Guid + "',");
            strSql.Append("'" + Name + "',");
            strSql.Append("'" + SimpName + "',");
            strSql.Append("'" + LinkMan + "',");
            strSql.Append("'" + Telephone + "',");
            strSql.Append("'" + Fax + "',");
            strSql.Append("'" + Address + "',");
            strSql.Append("'" + Zip + "',");
            strSql.Append("'" + Remark + "',");
            strSql.Append("'" + ProductName + "',");
            strSql.Append("'" + SellType + "',");
            strSql.Append("" + IsEnable.ToString() + "");
            strSql.Append(")");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #6
0
        /// <summary>
        /// 更新审核状态度-二级审核
        /// </summary>
        /// <returns></returns>
        public void CheckBill2(string RejectOrderGuid, int pass)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string ps_Sql = "";
                //删除主表
                if (pass == 1)
                {
                    //通过
                    ps_Sql = "update  RejectOrder  set CheckGuid2='" + SysParams.UserID + "',CheckDate2='" + DateTime.Now.ToString() + "'  where  RejectOrderGuid='" + RejectOrderGuid + "'";
                }
                else
                {
                    //不通过
                    ps_Sql = "update  RejectOrder  set CheckGuid2='',CheckDate2=null  where  RejectOrderGuid='" + RejectOrderGuid + "'";
                }

                pObj_Comm.Execute(ps_Sql);
                pObj_Comm.Close();
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #7
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Material set ");
            strSql.Append("UpperLimit=" + UpperLimit + ",");
            strSql.Append("LowerLimit=" + LowerLimit + ",");
            strSql.Append("IConsultPrice=" + IConsultPrice + ",");
            strSql.Append("EConsultPrice=" + EConsultPrice + ",");
            strSql.Append("CalculateMethod='" + CalculateMethod + "',");
            strSql.Append("Remark='" + Remark + "',");
            strSql.Append("MaterialId='" + MaterialId + "',");
            strSql.Append("MaterialName='" + MaterialName + "',");
            strSql.Append("ClassId='" + ClassId + "',");
            strSql.Append("Spec='" + Spec + "',");
            strSql.Append("Unit='" + Unit + "',");
            strSql.Append("BarNo='" + BarNo + "',");
            strSql.Append("Place='" + Place + "',");
            strSql.Append("Encapsulation='" + Encapsulation + "'");
            strSql.Append(" where MaterialGuid='" + MaterialGuid + "' ");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #8
0
        /// <summary>
        /// 判断此货品是否已被使用
        /// </summary>
        /// <returns></returns>
        public bool IsUseMaterial(string MaterialGuid)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            string strSql = " select MaterialGuid from (  select MaterialGuid  from BillDetail "
                            + "    union  select MaterialGuid  from CheckBillDetail "
                            + "    union  "
                            + "      select MaterialGuid  from RemoveBillDetail) M where M.MaterialGuid='" + MaterialGuid + "'";

            try
            {
                DataTable dt = pObj_Comm.ExeForDtl(strSql);
                pObj_Comm.Close();
                if (dt.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #9
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Dept set ");
            strSql.Append("DeptName='" + DeptName + "',");
            strSql.Append("DeptPerson='" + DeptPerson + "',");
            strSql.Append("Telephone='" + Telephone + "',");
            strSql.Append("Fax='" + Fax + "',");
            strSql.Append("Address='" + Address + "'");
            strSql.Append(" where DeptGuid='" + DeptGuid + "' ");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #10
0
        /// <summary>
        /// 得到所有产品类另信息
        /// </summary>
        /// <returns>pDTMain 字段信息集</returns>
        public DataTable GetMaterialDataByClassID(string classid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                if (classid != "")
                {
                    ps_Sql = "select  MaterialGuid,(select InterName from StorageClass where    InterId=ClassId) as 货品分类,MaterialId as 货号,MaterialName as 品名,Spec as 规格,BarNo as  助查码,"
                             + "Unit as 单位,CalculateMethod as 成本核算法,remark as 备注  from Material where  ClassId='" + classid + "' order by MaterialId";
                }
                else
                {
                    ps_Sql = "select  MaterialGuid,(select InterName from StorageClass where    InterId=ClassId) as 货品分类,MaterialId as 货号,MaterialName as 品名,Spec as 规格,BarNo as  助查码,"
                             + "Unit as 单位,CalculateMethod as 成本核算法,remark as 备注  from Material   order by MaterialId";
                }
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                return(pDTMain);
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #11
0
        /// <summary>
        /// 是否已经存在相同的货品
        /// </summary>
        /// <returns></returns>
        public bool IsExistMaterial(string Classid, string MaterialName, string MaterialID, string BarNo, string Spec, string Place, string Unit)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            string strSql = " select MaterialGuid  from Material where ClassId='" + Classid + "' and MaterialName='" + MaterialName + "' "
                            + " and MaterialID='" + MaterialID + "' and BarNo='" + BarNo + "' and Spec='" + Spec + "' and Place='" + Place + "' and Unit='" + Unit + "'";

            try
            {
                DataTable dt = pObj_Comm.ExeForDtl(strSql);
                pObj_Comm.Close();
                if (dt.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #12
0
        /// <summary>
        ///  采购入库单是否已开票报表(已勾结,未勾结)
        /// </summary>
        /// <param name="strsql"></param>
        /// <returns></returns>
        public DataTable sp_GetStockInOrderStatus_Report(string StockInOrderID, string strbegindate, string strenddate, string SupplierGuid, string IsInvoice)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[5, 2];
                par[0, 0] = "@StockInOrderID";
                par[0, 1] = StockInOrderID;
                par[1, 0] = "@BeginDate";
                par[1, 1] = strbegindate;
                par[2, 0] = "@EndDate";
                par[2, 1] = strenddate;
                par[3, 0] = "@SupplierGuid";
                par[3, 1] = SupplierGuid;
                par[4, 0] = "@IsInvoice";
                par[4, 1] = IsInvoice;


                dset = pComm.ExcuteSp("sp_GetStockInOrderStatus", par);

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #13
0
        /// <summary>
        ///   采购付款单报表
        /// </summary>
        /// <param name="strsql"></param>
        /// <returns></returns>
        public DataTable sp_Payment_Report(string strbegindate, string strenddate)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[2, 2];
                par[0, 0] = "@BeginDate";
                par[0, 1] = strbegindate;
                par[1, 0] = "@EndDate";
                par[1, 1] = strenddate;


                dset = pComm.ExcuteSp("sp_Payment_Report", par);

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #14
0
        /// <summary>
        /// 库存报表
        /// </summary>
        /// <param name="MaterialGuid"></param>
        /// <param name="StorageID"></param>
        /// <param name="MaterialTypeGuid"></param>
        /// <param name="EndDate"></param>
        /// <returns></returns>
        public DataTable StockReport(string MaterialGuid, string StorageID, string MaterialTypeGuid, string EndDate)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[4, 2];
                par[0, 0] = "@MaterialGuid";
                par[0, 1] = MaterialGuid;
                par[1, 0] = "@StorageID";
                par[1, 1] = StorageID;
                par[2, 0] = "@MaterialTypeGuid";
                par[2, 1] = MaterialTypeGuid;
                par[3, 0] = "@EndDate";
                par[3, 1] = EndDate;

                dset = pComm.ExcuteSp("sp_GetStorageReport", par);

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #15
0
        //判断规格是否已经存在
        public bool IsExistUnit(string flag, string strValue)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string    ps_Sql  = "select   UnitName   from BasicData where Flag=" + flag + "  and   UnitName='" + strValue + "'";
                DataTable pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #16
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [Dept](");
            strSql.Append("DeptGuid,DeptName,DeptPerson,Telephone,Fax,Address");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append("'" + DeptGuid + "',");
            strSql.Append("'" + DeptName + "',");
            strSql.Append("'" + DeptPerson + "',");
            strSql.Append("'" + Telephone + "',");
            strSql.Append("'" + Fax + "',");
            strSql.Append("'" + Address + "'");
            strSql.Append(")");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #17
0
        //根据ID得到基础数据的名称
        public string  GetBasicDataNameByUnitID(string strID)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string    ps_Sql  = "select top 1 UnitName  from BasicData where IsDelete=0 and UnitID=" + strID;
                DataTable pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    return(pDTMain.Rows[0]["UnitName"].ToString());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #18
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public bool IsOperateRight(string UserID, string ModuleID)
        {
            string          strsql = " select " + ModuleID + " from UserRight where userid='" + UserID + "'";
            CommonInterface pComm  = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataTable dtl = new DataTable();
                dtl = pComm.ExeForDtl(strsql.ToString());
                pComm.Close();

                if (dtl.Rows[0][ModuleID].ToString() == "1")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #19
0
        public string OperData(string StoredProcedureName, string[] Parameters, string[] ParametersValue, string[] ParametersType, string[] ParametersDirection)
        {
            /*string[] _Parameters = new string[4] { "as_datefrom", "as_dateto", "an_deptid", "aors" };
             * string[] _ParametersValue = new string[4] { sDateFrom, sDateTo, "24", "" };
             * string[] _ParametersType = new string[4] { "Varchar2", "Varchar2", "Varchar2", "RefCursor" };
             * string[] _ParametersDirection = new string[4] { "Input", "Input", "Input", "Output" };
             */
            string iResult;

            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.Oracle);

            try
            {
                iResult = pObj_Comm.ExecuteSP(StoredProcedureName, Parameters, ParametersValue, ParametersType, ParametersDirection);

                pObj_Comm.Close();

                return(iResult);
            }
            catch (Exception ex)
            {
                pObj_Comm.Close();
                throw ex;
            }
        }
Beispiel #20
0
        public DataTable  GetMaterial(string MaterialGuid)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);
            StringBuilder   strSql    = new StringBuilder();

            strSql.Append("select MaterialGuid ,MaterialId,MaterialName, ClassId,"
                          + " (select InterName from StorageClass where    InterId=ClassId)  as ClassInterName,Unit,"
                          + " (select UnitName from BasicData where UnitID=Unit ) as UnitInterName,Spec,"
                          + " (select UnitName from BasicData where UnitID=Spec ) as SpecInterName,"
                          + "  SafeStockSum ,CalculateMethod,Price,PicID,ClientID,SupplierGuid,"
                          + " (select Name from Supplier where Guid=SupplierGuid) as SupplierName, "
                          + " (select UnitName from BasicData where UnitID=CalculateMethod )  as CalculateMethodInterName, "
                          + " Place ,IsEnable,Remark ");

            //strSql.Append("[MaterialGuid],[MaterialId],[MaterialName],[ClassId],[Unit],[Spec],[SafeStockSum],[CalculateMethod],[Place],[IsEnable],[Remark]  ");
            strSql.Append(" from Material ");
            strSql.Append(" where MaterialGuid='" + MaterialGuid + "'");
            try
            {
                Material  Material = new Material();
                DataTable dt       = pObj_Comm.ExeForDtl(strSql.ToString());
                pObj_Comm.Close();
                return(dt);
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #21
0
        private void DataLoad()
        {
            string SqlOraStr = "SELECT * FROM T_DELIVERY_ROUTES WHERE DEPTID = 2 AND NVL(VALIDATED,0) =1 ";

            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.Oracle);

            try
            {
                pDTMain = pObj_Comm.ExeForDtl(SqlOraStr);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count != 0) //&&(myDs.Tables[0] !=null)
                {
                    LoadParentTree(pDTMain);
                }
                else
                {
                    MessageBox.Show("没有菜单!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                }
            }
            catch (Exception ex)
            {
                pObj_Comm.Close();
                throw ex;
            }
        }
Beispiel #22
0
        //------------------------------------------------------------------------

        //调用存储过程,得到某个物料的在指定仓库中的数量
        public DataTable sp_GetOneStorageSumData(string StorageID, string Materialguid)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[2, 2];
                par[0, 0] = "@StorageID";
                par[0, 1] = StorageID;
                par[1, 0] = "@MaterialGuid";
                par[1, 1] = Materialguid;

                dset = pComm.ExcuteSp("sp_GetOneStorageSumData", par);

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #23
0
        /// <summary>
        /// 得到订单是否已审核或已结单
        /// </summary>
        /// <param name="FatherMaterialGuid"></param>
        /// <returns></returns>
        public bool GetIsCheck(string HalfGoodsGuid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = " select HalfGoodsGuid,CheckGuid  from   HalfGoods where HalfGoodsGuid='" + HalfGoodsGuid + "' ";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    if (pDTMain.Rows[0]["CheckGuid"].ToString().Trim() != "")
                    {
                        return(true);
                    }

                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #24
0
        ///<summary>
        /// 是否执行出库数量预警
        /// </summary>
        /// <param name="pObj">信息集实例</param>
        /// <returns>返回True或False</returns>
        public bool OverNumStorage(string StorageID)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string pSql = "";
                pSql = "SELECT  OverNumStorage   FROM   YJ  ";
                DataTable pDT = pComm.ExeForDtl(pSql);
                pComm.Close();
                if (pDT.Rows.Count > 0)
                {
                    //判断当前传入仓库是否开启了预警,OverNumStorage值为 25:26:27:37:38:69:343,中间的数字就是仓库的编号
                    if (pDT.Rows[0]["OverNumStorage"].ToString().IndexOf(StorageID) >= 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                return(true);
            }
        }
Beispiel #25
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Client set ");
            strSql.Append("Name='" + Name + "',");
            strSql.Append("SimpName='" + SimpName + "',");
            strSql.Append("LinkMan='" + LinkMan + "',");
            strSql.Append("Telephone='" + Telephone + "',");
            strSql.Append("Fax='" + Fax + "',");
            strSql.Append("Address='" + Address + "',");
            strSql.Append("Zip='" + Zip + "',");
            strSql.Append("Remark='" + Remark + "',");
            strSql.Append("SellType='" + SellType + "',");
            strSql.Append("ProductName='" + ProductName + "',");
            strSql.Append("IsEnable=" + IsEnable.ToString() + "");
            strSql.Append(" where Guid='" + Guid + "' ");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #26
0
        ///<summary>
        /// 判断是否开启了单据删除时如有别的单据使用此单据的提醒
        /// </summary>
        /// <param name="pObj">信息集实例</param>
        /// <returns>返回True或False</returns>
        public bool OrderDeleteAlert()
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string pSql = "";
                pSql = "SELECT  OrderDeleteAlert   FROM   YJ  ";
                DataTable pDT = pComm.ExeForDtl(pSql);
                pComm.Close();
                if (pDT.Rows.Count > 0)
                {
                    //判断是否开启了单据删除时如有别的单据使用此单据的提醒
                    if (pDT.Rows[0]["OrderDeleteAlert"].ToString() == "1")
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                return(true);
            }
        }
Beispiel #27
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public void DeleteCheckBill(string CheckBillGuid)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pObj_Comm.BeginTrans();
                //删除主表
                string ps_Sql = "delete  from CheckBill  where  CheckBillGuid='" + CheckBillGuid + "'";
                pObj_Comm.Execute(ps_Sql);

                //删除明细表
                ps_Sql = "delete  from CheckBillDetail  where  CheckBillGuid='" + CheckBillGuid + "'";
                pObj_Comm.Execute(ps_Sql);

                pObj_Comm.CommitTrans();
                pObj_Comm.Close();
            }
            catch (Exception e)
            {
                pObj_Comm.RollbackTrans();
                pObj_Comm.Close();
                throw e;
            }
        }
Beispiel #28
0
        /// <summary>
        /// 得到所有产品类另信息
        /// </summary>
        /// <returns>pDTMain 字段信息集</returns>
        public DataTable GetMaterialData_CN(string strsql)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql = " select 'False' as selectvalue,MaterialGuid ,MaterialId as 物料编号,MaterialName 物料名称, "
                         + " (select InterName from StorageClass where    InterId=ClassId) as 分类,"
                         + " (select UnitName from BasicData where UnitID=Unit ) as 单位,"
                         + " (select UnitName from BasicData where UnitID=Spec ) as 规格型号,"
                         + " Price as 单价, "
                         + "case when IsEnable=1 then '停用' else  '正常' end  as 状态,PicID as 图号,ClientID as 客户编号,"
                         + " (select Name from Supplier where Guid=SupplierGuid) as 供应商, "
                         + " Remark as 备注  from Material " + strsql + "  order by MaterialId";

                //ps_Sql = "select  MaterialGuid,(select InterName from StorageClass where    InterId=ClassId)  as 货品分类,MaterialId as 货号,MaterialName as 品名,Spec as 规格,BarNo as  助查码,"
                //          + "Unit as 单位,CalculateMethod as 成本核算法,remark as 备注  from Material " + strsql + "  order by MaterialId";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                return(pDTMain);
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
        ///<summary>
        /// 得到当前是新增状态还是修改状态
        /// </summary>
        /// <param name="pObj">信息集实例</param>
        /// <returns>返回True或False</returns>
        public bool SaveStatus(Client pObj)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string pSql = "";
                pSql = "SELECT Guid   FROM   Client  " +
                       "where Guid  ='" + pObj.Guid + "'";
                DataTable pDT = pComm.ExeForDtl(pSql);
                pComm.Close();
                if (pDT.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
Beispiel #30
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into LOGINUSER(");
            strSql.Append("USERID,USERNAME,EMAIL,PASSWORD,IsEnable");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append("'" + USERID + "',");
            strSql.Append("'" + USERNAME + "',");
            strSql.Append("'" + EMAIL + "',");
            strSql.Append("'" + PASSWORD + "',");
            strSql.Append("" + IsEnable.ToString() + "");
            strSql.Append(")");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }