示例#1
0
        public List <MenuEntity> SelectMenuEntity()
        {
            string  sqlstr = "select * from dbo.Menu";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToMenuList(ds));
        }
示例#2
0
        public List <StorageWayEntity> SelectAllStorageWayEntity()
        {
            string  sqlstr = "select * from dbo.StorageWay";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToStorageWayEntityList(ds));
        }
示例#3
0
        public FeedbackInfomation AddStocktakingBill(StockModel sb)
        {
            FeedbackInfomation fi = new FeedbackInfomation();

            try
            {
                using (SqlConnection conn = SqlDataHelper.GetConnection())
                {
                    conn.Open();
                    SqlTransaction st = conn.BeginTransaction();
                    sb.Status = BaseInfo.FindBillStatusIDByName("未盘点");
                    long id = MySMDAL.InsertStocktakingBill(sb, st);
                    sb.StocktakingID = id;
                    bool ret = MySMDAL.GenerateStocktakingDetailInfo(sb, BaseInfo.FindBillStatusIDByName("未盘点"), st);
                    sb = MySMDAL.SelectStocktakingBill(sb.CmstID, sb.StocktakingID, st);
                    st.Commit();
                }
                fi.FeedbackMessage = Tips.SAVE_SUCCESS;
                fi.ErrorStatus     = STATUS_ADAPTER.SAVE_SUCCESS;
                fi.Result          = sb;
                return(fi);
            }
            catch (Exception ex)
            {
                fi.FeedbackMessage = ex.Message.ToString();
                fi.ErrorStatus     = STATUS_ADAPTER.SAVE_FAILED;
                fi.Result          = null;
                return(fi);
            }
        }
示例#4
0
        public DataSet SelectStocktakingDetails(long stocktakingId)
        {
            string  sqlstr = $" select * from Operator where Ope_id = {stocktakingId} ";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(ds);
        }
示例#5
0
        public List <RateTypeEntity> SelectAllRateTypeEntity()
        {
            string  sqlstr = "select * from dbo.RateType";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToRateTypeEntityList(ds));
        }
示例#6
0
        public List <Subject> SelectAllSubjectEntityList()
        {
            string  sqlstr = "select * from Subject ";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToSubjectEntityList(ds));
        }
示例#7
0
        public List <BillType> SelectAllBillTypeEntity()
        {
            string  sqlstr = "select * from BillType ";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToBillTypeEntity(ds));
        }
示例#8
0
        public List <SkuAuxType> SelectSkuAuxTypeEntityList()
        {
            string  sqlstr = "select * from SkuAuxType ";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToSignTypeEntityList(ds));
        }
示例#9
0
        public List <OrganizationEntity> SelectAllOrganizationEntity()
        {
            string  sqlstr = "SELECT con.Cmst_ID,con.Cmst_Name,con.Cmst_IfUse,op.Ope_Account from dbo.CmstOrganization AS con LEFT JOIN Operator AS op ON con.Cmst_ID = op.Ope_Cmst_ID WHERE op.Ope_IfSysAccount = 1";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToOrganizationEntityList(ds));
        }
示例#10
0
        public List <DepotsPropertyEntity> SelectAllDepotsPropertyEntity()
        {
            string  sqlstr = "select * from dbo.DepotsProperty";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToDepotsPropertyEntityList(ds));
        }
示例#11
0
        public FeedbackInfomation CheckStocktakingDetail(long stocktakingId, long stocktakingDetailId, int result, int checker, string remark)
        {
            FeedbackInfomation fi = new FeedbackInfomation();

            try
            {
                using (SqlConnection conn = SqlDataHelper.GetConnection())
                {
                    conn.Open();
                    SqlTransaction st = conn.BeginTransaction();
                    CheckDetail(stocktakingId, stocktakingDetailId, result, checker, remark, st);
                    StocktakingBillDetail sbd = MySMDAL.SelectStocktakingBillDetail(stocktakingDetailId, st);
                    st.Commit();
                    fi.Result          = sbd;
                    fi.FeedbackMessage = Tips.CHECK_SUCCESS;
                    fi.ErrorStatus     = STATUS_ADAPTER.CHECK_SUCCESS;
                    return(fi);
                }
            }
            catch (Exception ex)
            {
                fi.Result          = null;
                fi.ErrorStatus     = STATUS_ADAPTER.CHECK_FAILED;
                fi.FeedbackMessage = Tips.CHECK_SUCCESS + ":" + ex.Message.ToString();
                return(fi);
            }
        }
示例#12
0
        public int InsertRateType(RateTypeEntity rte)
        {
            StringBuilder sb = new StringBuilder("insert into RateType(Rty_Name,Rty_Remark,Rty_IfUse) values(");

            sb.AppendFormat(" '{0}',", rte.RtyName);
            sb.AppendFormat(" '{0}',", rte.RtyRemark);
            sb.AppendFormat(" '{0}')", rte.RtyIfUse == true ? 1 : 0);
            return(SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString()));
        }
示例#13
0
        public MenuEntity SelectMenuEntity(int menuID)
        {
            string sqlstr = "select * from dbo.Menu where Meu_ID={0}";

            sqlstr = string.Format(sqlstr, menuID);
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToMenuEntity(ds));
        }
示例#14
0
        public int UpdateRateType(RateTypeEntity rte)
        {
            StringBuilder sb = new StringBuilder("update dbo.RateType set");

            sb.AppendFormat(" Rty_Remark='{0}', ", rte.RtyRemark);
            sb.AppendFormat(" Rty_IfUse={0} ", rte.RtyIfUse == true ? 1 : 0);
            sb.AppendFormat(" where Rty_Id={0}", rte.RtyId);
            return(SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString()));
        }
示例#15
0
        public int UpdateMeasureWay(MeasureWayEntity me)
        {
            StringBuilder sb = new StringBuilder("update dbo.MeasureWay set");

            sb.AppendFormat(" Mwa_Remark='{0}', ", me.MwaRemark);
            sb.AppendFormat(" Mwa_IfUse={0} ", me.MwaIfUse == true ? 1 : 0);
            sb.AppendFormat(" where Mwa_Id={0}", me.MwaId);
            return(SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString()));
        }
示例#16
0
        public OperationEntity SelectOperationEntity(int operationID)
        {
            string sqlstr = "select * from dbo.Operation where Ope_ID={0}";

            sqlstr = string.Format(sqlstr, operationID);
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToOperationEntity(ds));
        }
示例#17
0
        public int UpdateDepotsProperty(DepotsPropertyEntity de)
        {
            StringBuilder sb = new StringBuilder("update dbo.DepotsProperty set");

            sb.AppendFormat(" Dpr_Remark='{0}', ", de.DprRemark);
            sb.AppendFormat(" Dpr_IfUse={0} ", de.DprIfUse == true ? 1 : 0);
            sb.AppendFormat(" where Dpr_Id={0}", de.DprId);
            return(SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString()));
        }
示例#18
0
        public OrganizationEntity SelectOrganizationByID(int cmstID)
        {
            string sqlstr = "select * from dbo.CmstOrganization where Cmst_ID={0}";

            sqlstr = string.Format(sqlstr, cmstID);
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(DsToOrganizationEntity(ds));
        }
示例#19
0
        public DataSet SelectOrganizationByCmstName(string cmstName)
        {
            string sqlstr = "select * from dbo.CmstOrganization where Cmst_Name='{0}'";

            sqlstr = string.Format(sqlstr, cmstName);
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            return(ds);
        }
示例#20
0
        public int InsertMeasureWay(MeasureWayEntity me)
        {
            StringBuilder sb = new StringBuilder("insert into MeasureWay(Mwa_Name,Mwa_Remark,Mwa_IfUse) values(");

            sb.AppendFormat(" '{0}',", me.MwaName);
            sb.AppendFormat(" '{0}',", me.MwaRemark);
            sb.AppendFormat(" '{0}')", me.MwaIfUse == true ? 1 : 0);
            return(SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString()));
        }
示例#21
0
        public int InsertDepotsProperty(DepotsPropertyEntity de)
        {
            StringBuilder sb = new StringBuilder("insert into DepotsProperty(Dpr_Name,Dpr_Remark,Dpr_IfUse) values(");

            sb.AppendFormat(" '{0}',", de.DprName);
            sb.AppendFormat(" '{0}',", de.DprRemark);
            sb.AppendFormat(" '{0}')", de.DprIfUse == true ? 1 : 0);
            return(SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString()));
        }
示例#22
0
        public bool CheckedOperatorAccountRepeate(string account, int operatorId)
        {
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), "Operator_View_Check", account, operatorId);

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                return(true);
            }
            return(false);
        }
示例#23
0
        public DataSet SelectAllMenu()
        {
            string  sqlstr = "select * from dbo.Menu";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                return(ds);
            }
            return(null);
        }
示例#24
0
        public int InsertOperation(OperationEntity oe)
        {
            string sqlstr = "insert into dbo.Operation(Ope_Meu_ID,Csy_ID,Ope_Name,Ope_Url)values({0},{1},'{2}','{3}')";

            sqlstr = string.Format(sqlstr, oe.MenuID, oe.CsyID, oe.OperateName, oe.OperateUrl);
            int ret = SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            if (ret > 0)
            {
                return(1);
            }
            return(-1);
        }
示例#25
0
        public int InsertMenu(MenuEntity me)
        {
            string sqlstr = "insert into dbo.Menu (Csy_ID,Meu_Menu,Meu_FatherMenuID,Meu_Rank,Meu_Url)values({0},'{1}',{2},{3},'{4}')";

            sqlstr = string.Format(sqlstr, me.CsyID, me.MenuName, me.FatherID, me.Rank, me.Url);
            int ret = SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            if (ret > 0)
            {
                return(1);
            }
            return(-1);
        }
示例#26
0
        public bool InsertRoleOperate(int roleId, int operationId, int cmstid)
        {
            int ret = SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), "RoleOperate_Insert", roleId, operationId, cmstid);

            if (ret > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#27
0
        public int InsertOrganization(OrganizationEntity oe)
        {
            StringBuilder sb = new StringBuilder("insert into dbo.CmstOrganization(Cmst_ID,Cmst_Name,Cmst_IfUse)values(");

            sb.AppendFormat(" {0},", Convert.ToInt32(oe.CmstID));
            sb.AppendFormat(" '{0}',", oe.CmstName);
            sb.AppendFormat(" {0})", oe.CmstIfUse == true ? 1 : 0);
            //DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString());
            int ret = SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sb.ToString());

            if (ret > 0)
            {
                return(1);
            }
            return(-1);
        }
示例#28
0
        public DepotsPropertyEntity SelectDepotsPropertyByName(string name)
        {
            string sqlstr = "select * from dbo.DepotsProperty where Dpr_name='{0}'";

            sqlstr = String.Format(sqlstr, name);
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DsToDepotsPropertyEntity(ds));
            }
            else
            {
                return(null);
            }
        }
示例#29
0
        public RateTypeEntity SelectRateTypeByName(string name)
        {
            string sqlstr = "select * from dbo.RateType where Rty_Name='{0}'";

            sqlstr = String.Format(sqlstr, name);
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DsToRateTypeEntity(ds));
            }
            else
            {
                return(null);
            }
        }
示例#30
0
 public int InsertOperatorEntity(OperatorEntity oe)
 {
     try
     {
         string sqlstr = $"insert into dbo.Operator(Ope_Account,Ope_Name,Ope_Password,Ope_IfUse,Ope_RevisionTime,Ope_Cmst_ID,Ope_Rol_ID,Ope_IfSysAccount)values('{oe.Account}','{oe.OperatorName}','{oe.Password}','{oe.IfUse}','{oe.UpdateTime}',{oe.CmstID},{oe.RoleID},'{oe.IfSysAccount}')";
         int    ret    = SqlDataHelper.ExecuteNonQuery(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);
         if (ret > 0)
         {
             return(1);
         }
         return(-1);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }