/// <summary>
        /// 根据采购订单号与物料号来取得这个料件做采购订单中的单价
        /// </summary>
        /// <param name="StockOrderGuid"></param>
        /// <param name="MaterialGuID"></param>
        /// <returns></returns>
        public decimal GetStockOrderPriceByMaterial(string StockOrderGuid, string MaterialGuID)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = " select  MaterialPrice  from   StockOrderDetail where StockOrderGuid='" + StockOrderGuid + "' and  MaterialGuID='" + MaterialGuID + "'";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    if (pDTMain.Rows[0]["MaterialPrice"].ToString().Trim() != "")
                    {
                        return(decimal.Parse(pDTMain.Rows[0]["MaterialPrice"].ToString()));
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
        ///<summary>
        ///删除数据
        /// </summary>
        /// <param name="pObj">信息集实体类</param>
        /// <returns>返回保存成功(true)或失败(false)</returns>
        public void DeleteBill(string InitialGoodsguid)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.BeginTrans();

                //保存单据主表数据
                //先删除主表数据
                string strDeleteSql = "Delete from InitialGoods where  InitialGoodsGuid='" + InitialGoodsguid + "'";
                pComm.Execute(strDeleteSql);


                //删除明细表
                strDeleteSql = "Delete from InitialGoodsDetail where  InitialGoodsGuid='" + InitialGoodsguid + "'";
                pComm.Execute(strDeleteSql);


                pComm.CommitTrans();
            }
            catch (Exception e)
            {
                pComm.RollbackTrans();
                pComm.Close();
                throw e;
            }
        }
        ///<summary>
        /// 保存用户属于那个权限组
        /// </summary>
        /// <param name="tableid">SQL查询条件</param>
        /// <returns>存放查询结果的DataTable</returns>
        public void SaveUserRightGroup(List <string> lstUser, List <string> lstgroup)
        {
            string          StrSQL = "";
            CommonInterface pComm  = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.BeginTrans();

                for (int i = 0; i < lstUser.Count; i++)
                {
                    //先删除此用户原来属于的权限组
                    StrSQL = "delete from UserRightGroup where UserID='" + lstUser[i] + "'";
                    pComm.Execute(StrSQL);


                    //再添加此用户的权限组
                    for (int j = 0; j < lstgroup.Count; j++)
                    {
                        StrSQL = " insert into UserRightGroup(UserID,GroupID) values('" + lstUser[i] + "','" + lstgroup [j] + "')";
                        pComm.Execute(StrSQL);
                    }
                }

                pComm.CommitTrans();
                pComm.Close();
            }
            catch (Exception e)
            {
                pComm.RollbackTrans();
                pComm.Close();
                throw e;
            }
        }
示例#4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string sDateFrom = dtpDateFrom.Value.ToString("yyyy-MM-dd");
            string sDateTo   = dtpDateTo.Value.ToString("yyyy-MM-dd");
            string sDept     = "%" + txtDeptName.Text.Trim() + "%";

            string[] _Parameters = new string[4] {
                "as_datefrom", "as_dateto", "an_deptid", "aors"
            };
            string[] _ParametersValue = new string[4] {
                sDateFrom, sDateTo, sDept, ""
            };
            string[] _ParametersType = new string[4] {
                "Varchar2", "Varchar2", "Varchar2", "RefCursor"
            };
            string[] _ParametersDirection = new string[4] {
                "Input", "Input", "Input", "Output"
            };
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.Oracle);

            try
            {
                DataTable pDTMain = pObj_Comm.ExecuteSPSursor("CX_SALE.cur_fin_dept_capital", _Parameters, _ParametersValue, _ParametersType, _ParametersDirection).Tables[0];
                gridControl1.DataSource = pDTMain;

                pObj_Comm.Close();
            }
            catch (Exception ex)
            {
                pObj_Comm.Close();
                throw ex;
            }
        }
示例#5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [Dept](");
            strSql.Append("DeptGuid,DeptName,DeptPerson,Telephone,Fax,Address,IsEnable");
            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("" + 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;
            }
        }
        ///<summary>
        /// 得到当前是新增状态还是修改状态
        /// </summary>
        /// <param name="pObj">信息集实例</param>
        /// <returns>返回True或False</returns>
        public bool SaveStatus(LoginUser pObj)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                string pSql = "";
                pSql = "SELECT USERID  FROM   LoginUser  " +
                       "where USERID ='" + pObj.USERID + "'";
                DataTable pDT = pComm.ExeForDtl(pSql);
                pComm.Close();
                if (pDT.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 得到生产领料计划单中的母件Guid
        /// </summary>
        /// <param name="FatherMaterialGuid"></param>
        /// <returns></returns>
        public string GetDrawPlanFatherMaterialGuid(string DrawPlanGuid)
        {
            string          returnvalue = "";
            string          ps_Sql      = "";
            DataTable       pDTMain     = new DataTable();
            CommonInterface pObj_Comm   = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = " select  top 1 MaterialGuid   from  DrawPlanDetail   where  DrawPlanGuid='" + DrawPlanGuid + "'";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    returnvalue = pDTMain.Rows[0]["MaterialGuid"].ToString().Trim();
                }
                else
                {
                    returnvalue = "";
                }

                return(returnvalue);
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
示例#8
0
        private void button1_Click(object sender, EventArgs e)
        {
            string sDateFrom = dtpDateFrom.Value.ToString("yyyyMMdd");
            string sDateTo   = dtpDateTo.Value.ToString("yyyyMMdd");
            string sDelivery = txtDelivery.Text.Trim();

            string[] _Parameters = new string[4] {
                "as_delivery", "as_datefrom", "as_dateto", "aors"
            };

            string[] _ParametersValue = new string[4] {
                sDelivery, sDateFrom, sDateTo, ""
            };
            string[] _ParametersType = new string[4] {
                "Varchar2", "Varchar2", "Varchar2", "RefCursor"
            };
            string[] _ParametersDirection = new string[4] {
                "Input", "Input", "Input", "Output"
            };

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

            try
            {
                DataTable pDTMain = pObj_Comm.ExecuteSPSursor("NEIIP_REPORT.P_GET_DISPATCH_STORE_REPORT", _Parameters, _ParametersValue, _ParametersType, _ParametersDirection).Tables[0];
                gridControl1.DataSource = pDTMain;

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

            try
            {
                string pSql = "";
                pSql = "SELECT EmpGuid   FROM   Employee  " +
                       "where EmpGuid  ='" + pObj.EmpGuid + "'";
                DataTable pDT = pComm.ExeForDtl(pSql);
                pComm.Close();
                if (pDT.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
示例#10
0
        /// <summary>
        /// 得到某个料件的平均单价
        /// </summary>
        /// <returns></returns>
        public decimal sp_GetMaterialPrice(string MaterialGuID, string Depot)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                decimal price = 0;
                DataSet dset  = new DataSet();
                string[,] par;
                par       = new string[1, 2];
                par[0, 0] = "@MaterialGuID";
                par[0, 1] = MaterialGuID;
                dset      = pComm.ExcuteSp("sp_GetMaterialSumByDepot", par);

                pComm.Close();

                if (dset.Tables[0].Rows.Count > 0)
                {
                    DataRow[] drArr = dset.Tables[0].Select("DepotName='" + Depot + "'");
                    if (drArr.Length > 0)
                    {
                        DataRow dr = drArr[0];
                        price = decimal.Parse(dr[2].ToString());
                    }
                }

                return(price);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
示例#11
0
        /// <summary>
        /// 得到数据-各仓库汇总表
        /// </summary>
        /// <returns></returns>
        public DataTable sp_GetAllDepotSum(string MaterialGuid, string begindate, string enddate)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[3, 2];
                par[0, 0] = "@MaterialGuid";
                par[0, 1] = MaterialGuid;
                par[1, 0] = "@BeginDate";
                par[1, 1] = begindate;
                par[2, 0] = "@EndDate";
                par[2, 1] = enddate;
                dset      = pComm.ExcuteSp("sp_GetAllDepotSum", par);

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
示例#12
0
        //-------------------------------------------------------------------------------------------------

        /// <summary>
        /// 得到数据-库存查询(包括出入库,调拨)
        /// </summary>
        /// <param name="strsql">查询条件仓库</param>
        /// <param name="strsql2">查询条件调拨</param>
        /// <param name="depot">仓库名</param>
        /// <returns></returns>
        public DataTable sp_GetDepotMaterailSum(string strsql1, string strsql2, string strsql3, string depot, string strsql4, string strsql5)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[6, 2];
                par[0, 0] = "@WhereSql";
                par[0, 1] = strsql1;
                par[1, 0] = "@WhereSql2";
                par[1, 1] = strsql2;
                par[2, 0] = "@WhereSql3";
                par[2, 1] = strsql3;
                par[3, 0] = "@Depot";
                par[3, 1] = depot;
                par[4, 0] = "@WhereSql4";
                par[4, 1] = strsql4;
                par[5, 0] = "@WhereSql5";
                par[5, 1] = strsql5;

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

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
示例#13
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Material set ");
            strSql.Append("MaterialID='" + MaterialID + "',");
            strSql.Append("MaterialName='" + MaterialName + "',");
            strSql.Append("ClassId='" + ClassId + "',");
            strSql.Append("Unit='" + Unit + "',");
            strSql.Append("Spec='" + Spec + "',");
            strSql.Append("SafeStockSum=" + SafeStockSum + ",");
            strSql.Append("CalculateMethod='" + CalculateMethod + "',");
            strSql.Append("Place='" + Place + "',");
            strSql.Append("IsEnable=" + IsEnable + ",");
            strSql.Append("Remark='" + Remark + "',");
            strSql.Append("Price=" + Price + ",");
            strSql.Append("PicID='" + PicID + "',");
            strSql.Append("ClientID='" + ClientID + "',");
            strSql.Append("SupplierGuid='" + SupplierGuid + "'");
            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;
            }
        }
        /// <summary>
        /// 是否已经存在相同的设备编号
        /// </summary>
        /// <returns></returns>
        public bool IsExistEquipementID(string EquipmentGuid, string EquipmentID)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);
            string          strSql    = "";

            strSql = " select EquipmentID  from Equipment where EquipmentGuid<>'" + EquipmentGuid + "' and EquipmentID='" + EquipmentID + "'";

            try
            {
                DataTable dt = pObj_Comm.ExeForDtl(strSql);
                pObj_Comm.Close();
                if (dt.Rows.Count > 0)
                {
                    return(true);  //Exist
                }
                else
                {
                    return(false); //Not Exist
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public LoginUser GetLoginUser(string USERID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  ");
            strSql.Append("USERID,USERNAME,EMAIL,PASSWORD,IsEnable ");
            strSql.Append(" from LOGINUSER ");
            strSql.Append(" where USERID='" + USERID + "'");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                LoginUser lu = new LoginUser();
                DataSet   ds = new DataSet();
                ds = pComm.ExeForDst(strSql.ToString());//执行Sql语句返回DataSet
                pComm.Close();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lu.USERID   = ds.Tables[0].Rows[0]["USERID"].ToString();
                    lu.USERNAME = ds.Tables[0].Rows[0]["USERNAME"].ToString();
                    lu.EMAIL    = ds.Tables[0].Rows[0]["EMAIL"].ToString();
                    lu.PASSWORD = ds.Tables[0].Rows[0]["PASSWORD"].ToString();
                    lu.IsEnable = int.Parse(ds.Tables[0].Rows[0]["IsEnable"].ToString());
                }

                return(lu);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
示例#16
0
        /// <summary>
        /// 得到某个料件是否已经入库并且审核
        /// </summary>
        /// <param name="FatherMaterialGuid"></param>
        /// <returns></returns>
        public bool GetFileInStorageIsCheck(string FileGuid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = " select  CheckGuid2  from   V_FileInStorageDetail  where FileGuid='" + FileGuid + "' ";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

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


                    return(false);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 得到一个登陆用户名称
        /// </summary>
        public string  GetLoginUserName(string USERID)
        {
            string        strName = "";
            StringBuilder strSql  = new StringBuilder();

            strSql.Append("select USERNAME from LOGINUSER ");
            strSql.Append(" where USERID='" + USERID + "'");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataTable dtl = new DataTable();
                dtl = pComm.ExeForDtl(strSql.ToString());
                pComm.Close();
                if (dtl.Rows.Count > 0)
                {
                    strName = dtl.Rows[0]["USERNAME"].ToString();
                }

                return(strName);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 得到报废单主表数据
        /// </summary>
        /// <param name="FatherMaterialGuid"></param>
        /// <returns></returns>
        public string GetMaterialByFileApplyDetailGuid(string FileApplyDetailGuid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = "select  FileGuid   from  FileApplyDetail where FileApplyDetailGuid='" + FileApplyDetailGuid + "'";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);

                pObj_Comm.Close();

                if (pDTMain.Rows.Count > 0)
                {
                    return(pDTMain.Rows[0]["FileGuid"].ToString().Trim());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
示例#19
0
        //修改1
        //计算客户订单中产品所需要用到的生产领料用量--按BOM的层级来加载出物料
        public DataTable CalcMaterialDrawPlan3(string strDrawPlanGuID, string strlevel)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[2, 2];
                par[0, 0] = "@DrawPlanGuID";
                par[0, 1] = strDrawPlanGuID;
                par[1, 0] = "@Level";
                par[1, 1] = strlevel;

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

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 判断当前用户是否有查看此文件的权限,申请单中的申请人中有此用户或此人在这个申请部门中才能相看权限
        /// </summary>
        /// <param name="FileApplyGuid"></param>
        /// <param name="LoginUserID"></param>
        /// <returns></returns>
        public bool IsViewRight_User(string FileApplyGuid, string LoginUserName)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = " select  FileApplyPersonDetailGuID from   FileApplyPersonDetail F left join employee  E on  F.PersonGuID=E.EmpGuID where F.FileApplyGuid='" + FileApplyGuid + "' and E.EmpName='" + LoginUserName + "'";
                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;
            }
        }
示例#21
0
        ///<summary>
        /// 输入条件返回结果查询
        /// </summary>
        /// <param name="tableid">SQL查询条件</param>
        /// <returns>存放查询结果的DataTable</returns>
        public string GetBillName(string flag)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataTable dtl    = new DataTable();
                string    StrSQL = " select OrderName from BillAutoID  where  Flag='" + flag + "'";

                dtl = pComm.ExeForDtl(StrSQL);
                pComm.Close();

                if (dtl.Rows.Count > 0)
                {
                    return(dtl.Rows[0]["OrderName"].ToString());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
        ///<summary>
        ///删除数据
        /// </summary>
        /// <param name="pObj">信息集实体类</param>
        /// <returns>返回保存成功(true)或失败(false)</returns>
        public void DeleteBill(string FileApplyguid)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.BeginTrans();

                //保存单据主表数据
                //先删除主表数据
                string strDeleteSql = "Delete from FileApply where  FileApplyGuid='" + FileApplyguid + "'";
                pComm.Execute(strDeleteSql);


                //删除明细表
                strDeleteSql = "Delete from FileApplyDetail where  FileApplyGuid='" + FileApplyguid + "'";
                pComm.Execute(strDeleteSql);


                //删除申请人明细表
                strDeleteSql = "Delete from FileApplyPersonDetail where  FileApplyGuid='" + FileApplyguid + "'";
                pComm.Execute(strDeleteSql);



                pComm.CommitTrans();
            }
            catch (Exception e)
            {
                pComm.RollbackTrans();
                pComm.Close();
                throw e;
            }
        }
示例#23
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("IsEnable=" + IsEnable.ToString() + "");
            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;
            }
        }
示例#24
0
        /// <summary>
        /// 查找所有分类信息
        /// </summary>
        /// <returns>pDTMain 产品信息集</returns>
        public string GetMaxNodeData(string fatherid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = "SELECT Max(InterID) as InterID FROM StorageClass where FatherID ='" + fatherid + "'";
                pDTMain = pObj_Comm.ExeForDtl(ps_Sql);
                pObj_Comm.Close();

                if (pDTMain.Rows[0]["InterID"].ToString() == "")
                {
                    return(fatherid + "0001");
                }
                else
                {
                    return(pDTMain.Rows[0]["InterID"].ToString());
                }
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
        /// <summary>
        /// 得到订单是否已审核或已结单
        /// </summary>
        /// <param name="FatherMaterialGuid"></param>
        /// <returns></returns>
        public bool GetIsCheck(string InitialGoodsGuid)
        {
            string          ps_Sql    = "";
            DataTable       pDTMain   = new DataTable();
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                ps_Sql  = " select InitialGoodsGuid,CheckGuid  from   InitialGoods where InitialGoodsGuid='" + InitialGoodsGuid + "' ";
                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;
            }
        }
示例#26
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");
            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(")");
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.Execute(strSql.ToString());//执行Sql语句无返回值
                pComm.Close();
                return(true);
            }
            catch (System.Exception e)
            {
                pComm.Close();
                throw e;
            }
        }
示例#27
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public void DeleteRemoveBill(string RemoveBillGuid)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

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

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

                pObj_Comm.CommitTrans();
                pObj_Comm.Close();
            }
            catch (Exception e)
            {
                pObj_Comm.RollbackTrans();
                pObj_Comm.Close();
                throw e;
            }
        }
示例#28
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(" 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;
            }
        }
示例#29
0
        /// <summary>
        /// 更新审核状态度
        /// </summary>
        /// <returns></returns>
        public void CheckBill(string QuitOrderGuid, int pass)
        {
            CommonInterface pObj_Comm = CommonFactory.CreateInstance(CommonData.sql);

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

                pObj_Comm.Execute(ps_Sql);
                pObj_Comm.Close();
            }
            catch (Exception e)
            {
                pObj_Comm.Close();
                throw e;
            }
        }
        //采购订单执行情况报表,
        public DataTable sp_GetSelectStockOrderDataReport(string strStockOrderID, string begindate, string enddate, string endflag)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                DataSet dset = new DataSet();
                string[,] par;
                par       = new string[4, 2];
                par[0, 0] = "@StockOrderID";
                par[0, 1] = strStockOrderID;
                par[1, 0] = "@BeginDate";
                par[1, 1] = begindate;
                par[2, 0] = "@EndDate";
                par[2, 1] = enddate;
                par[3, 0] = "@endFlag";
                par[3, 1] = endflag;

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

                pComm.Close();
                return(dset.Tables[0]);
            }
            catch (Exception e)
            {
                pComm.Close();
                throw e;
            }
        }