コード例 #1
0
ファイル: UserGroup_DB.cs プロジェクト: shew990/TaiBang
        protected override string GetFilterSql(UserModel user, T_UserGroupInfo model)
        {
            string strSql = base.GetFilterSql(user, model);
            string strAnd = " and ";


            if (!Common_Func.IsNullOrEmpty(model.UserGroupNo))
            {
                strSql += strAnd;
                strSql += " (USERGROUPNO like '%" + model.UserGroupNo + "%')  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.UserGroupName))
            {
                strSql += strAnd;
                strSql += " (USERGROUPNAME like '%" + model.UserGroupName + "%')  ";
            }

            if (model.UserGroupType >= 1)
            {
                strSql += strAnd;
                strSql += " USERGROUPTYPE = " + model.UserGroupType + "";
            }

            return(strSql);
        }
コード例 #2
0
ファイル: Material_Func.cs プロジェクト: shew990/TaiBang
        protected override bool CheckModelBeforeSave(T_MaterialInfo model, ref string strError)
        {
            T_Material_DB mdb = new T_Material_DB();

            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.MaterialNo))
            {
                strError = "物料编号不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.MaterialDesc))
            {
                strError = "物料名称不能为空!";
                return(false);
            }

            //新增的情况需要验证物料编号是否存在
            if (model.ID <= 0)
            {
                if (mdb.CheckMaterialExist(model) > 0)
                {
                    strError = "物料编码已经存在!";
                    return(false);
                }
            }


            return(true);
        }
コード例 #3
0
        protected override string GetFilterSql(UserModel user, T_CustomerInfo customer)
        {
            string strSql = " where isnull(isDel,0) != 2  ";
            string strAnd = " and ";

            if (!Common_Func.IsNullOrEmpty(customer.CustomerNo))
            {
                strSql += strAnd;
                strSql += " (CustomerNo like '%" + customer.CustomerNo + "%' or CustomerName like '%" + customer.CustomerNo + "%')  ";
            }


            if (!string.IsNullOrEmpty(customer.ContactPerson))
            {
                strSql += strAnd;
                strSql += " ContactPerson like '%" + customer.ContactPerson + "%'";
            }

            if (!string.IsNullOrEmpty(customer.ContactTel))
            {
                strSql += strAnd;
                strSql += " ContactTel like '%" + customer.ContactTel + "%'";
            }
            if (!string.IsNullOrEmpty(customer.CustomerName))
            {
                strSql += strAnd;
                strSql += " CustomerName like '%" + customer.CustomerName + "%'";
            }



            return(strSql);
        }
コード例 #4
0
        //编号 名称 类型 产能
        protected override string GetFilterSql(UserModel user, T_ProductLine customer)
        {
            string strSql = " where nvl(isDel,0) != 2  ";
            string strAnd = " AND ";

            if (!Common_Func.IsNullOrEmpty(customer.Sn))
            {
                strSql += strAnd;
                strSql += " (SN like '%" + customer.Sn + "%')  ";
            }


            if (!string.IsNullOrEmpty(customer.MachineLineName))
            {
                strSql += strAnd;
                strSql += " MachineLineName like '%" + customer.MachineLineName + "%'";
            }

            if (!string.IsNullOrEmpty(customer.LineType))
            {
                strSql += strAnd;
                strSql += " LineType = '" + customer.LineType + "'";
            }

            return(strSql);
        }
コード例 #5
0
        //编号 名称 类型 产能
        protected override string GetFilterSql(UserModel user, T_Team customer)
        {
            string strSql = " where isnull(isDel,0) != 2  ";
            string strAnd = " AND ";

            if (!Common_Func.IsNullOrEmpty(customer.teamCode))
            {
                strSql += strAnd;
                strSql += " (teamCode like '%" + customer.teamCode + "%')  ";
            }


            if (!string.IsNullOrEmpty(customer.teamName))
            {
                strSql += strAnd;
                strSql += " teamName like '%" + customer.teamName + "%'";
            }

            if (!string.IsNullOrEmpty(customer.LeaderCode))
            {
                strSql += strAnd;
                strSql += " LeaderCode like '%" + customer.LeaderCode + "%'";
            }

            if (!string.IsNullOrEmpty(customer.Position))
            {
                strSql += strAnd;
                strSql += " Position like '%" + customer.Position + "%'";
            }

            return(strSql);
        }
コード例 #6
0
ファイル: Machine_DB.cs プロジェクト: shew990/TaiBang
        protected override string GetFilterSql(UserModel user, T_Machine customer)
        {
            string strSql = " where nvl(isDel,0) != 2  ";
            string strAnd = " and ";

            if (!Common_Func.IsNullOrEmpty(customer.MachineCode))
            {
                strSql += strAnd;
                strSql += " (MachineCode like '%" + customer.MachineCode + "%')  ";
            }


            if (!string.IsNullOrEmpty(customer.MachineName))
            {
                strSql += strAnd;
                strSql += " MachineName like '%" + customer.MachineName + "%'";
            }

            if ((!string.IsNullOrEmpty(customer.MachineType)))
            {
                strSql += strAnd;
                strSql += " MachineType like '%" + customer.MachineType + "%'";
            }

            return(strSql);
        }
コード例 #7
0
        protected override string GetFilterSql(UserModel user, T_TransportSupDetailInfo model)
        {
            string strSql = " where isnull(isDel,0) != 2";
            string strAnd = " and ";

            if (!Common_Func.IsNullOrEmpty(model.PlateNumber))
            {
                strSql += strAnd;
                strSql += " PlateNumber LIKE '%" + model.PlateNumber + "%'  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.PalletNo))
            {
                strSql += strAnd;
                //strSql += " ID In (Select WarehouseID From T_House Where HouseNo LIKE '%" + model.HouseNo + "%' OR HouseName Like '%" + model.HouseNo + "%') ";
                strSql += " PalletNo LIKE '%" + model.PalletNo + "%' ";
            }

            if (!Common_Func.IsNullOrEmpty(model.ErpVoucherNo))
            {
                strSql += strAnd;
                strSql += " ErpVoucherNo LIKE '%" + model.ErpVoucherNo + "%' ";
            }

            if (!Common_Func.IsNullOrEmpty(model.strType))
            {
                strSql += strAnd;
                strSql += " strType = '" + model.strType + "' ";
            }

            if (!Common_Func.IsNullOrEmpty(model.VoucherNo))
            {
                strSql += strAnd;
                strSql += " VoucherNo = '" + model.VoucherNo + "' ";
            }


            if (!Common_Func.IsNullOrEmpty(model.Creater))
            {
                strSql += strAnd;
                strSql += " Creater Like '%" + model.Creater + "%' ";
            }

            if (model.DateFrom != null)
            {
                strSql += strAnd;
                strSql += " CreateTime >= " + model.DateFrom.ToDateTime().Date.ToOracleTimeString() + "  ";
            }

            if (model.DateTo != null)
            {
                strSql += strAnd;
                strSql += " CreateTime <= " + model.DateTo.ToDateTime().AddDays(1).Date.ToOracleTimeString() + " ";
            }

            return(strSql);
        }
コード例 #8
0
        protected override string GetFilterSql(UserModel user, UserInfo model)
        {
            string strSql = base.GetFilterSql(user, model);
            string strAnd = " and ";


            if (!Common_Func.IsNullOrEmpty(model.UserNo))
            {
                strSql += strAnd;
                strSql += " (USERNO like '%" + model.UserNo + "%')  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.UserName))
            {
                strSql += strAnd;
                strSql += " (UserName like '%" + model.UserName + "%')  ";
            }

            if (model.IsOnline >= 1)
            {
                strSql += strAnd;
                strSql += " LoginIP is " + (model.IsOnline.ToBoolean() ? "not" : "") + " null ";
            }

            if (!string.IsNullOrEmpty(model.Creater))
            {
                strSql += strAnd;
                strSql += " Creater Like '%" + model.Creater + "%' ";
            }

            if (model.DateFrom != null)
            {
                strSql += strAnd;
                strSql += " CreateTime " + this.GetDateFromFilter(model);
            }

            if (model.DateTo != null)
            {
                strSql += strAnd;
                strSql += " CreateTime  " + this.GetDateToFilter(model);
            }

            if (model.IsPick > 0)
            {
                strSql += strAnd;
                strSql += " IsPick ='" + model.IsPick + "' ";
            }

            if (model.LoginTime != null)
            {
                strSql += strAnd;
                strSql += " isnull(LoginTime,'') <> '' ";
            }


            return(strSql);
        }
コード例 #9
0
        protected override string GetFilterSql(UserModel user, T_MaterialInfo model)
        {
            string strSql = string.Empty;
            string strAnd = " and ";

            strSql += base.GetFilterSql(user, model);

            if (!Common_Func.IsNullOrEmpty(model.MaterialNo))
            {
                strSql += strAnd;
                strSql += " (MaterialNo LIKE '" + model.MaterialNo + "%' )  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.MaterialDesc))
            {
                strSql += strAnd;
                strSql += " MaterialDesc Like '" + model.MaterialDesc + "%'";
            }

            if (!Common_Func.IsNullOrEmpty(model.SupplierNo))
            {
                strSql += strAnd;
                strSql += "( SupplierNo Like '" + model.SupplierNo + "%'  or SupplierName Like '" + model.SupplierNo + "%' )";
            }

            if (model.DateFrom != null)
            {
                strSql += strAnd;
                strSql += " CreateTime >= " + model.DateFrom.ToDateTime().Date.AddDays(-1).ToOracleTimeString() + "  ";
            }

            if (model.DateTo != null)
            {
                strSql += strAnd;
                strSql += " CreateTime <= " + model.DateTo.ToDateTime().Date.AddDays(1).ToOracleTimeString() + " ";
            }

            if (!string.IsNullOrEmpty(model.BatchNo))
            {
                strSql += strAnd;
                strSql += " Batchno = '" + model.BatchNo + "' ";
            }

            if (!string.IsNullOrEmpty(model.WareHouseNo))
            {
                strSql += strAnd;
                strSql += " WareHouseNo = '" + model.WareHouseNo + "' ";
            }

            if (!string.IsNullOrEmpty(model.AreaNo))
            {
                strSql += strAnd;
                strSql += " AreaNo = '" + model.AreaNo + "' ";
            }

            return(strSql);
        }
コード例 #10
0
        protected override string GetFilterSql(UserModel user, T_TransportSupplier model)
        {
            string strSql = base.GetFilterSql(user, model);
            string strAnd = " and ";

            if (!Common_Func.IsNullOrEmpty(model.TransportSupplierID.ToString()) || !Common_Func.IsNullOrEmpty(model.TransportSupplierName.ToString()))
            {
                strSql += strAnd;
                strSql += " (Transportsupplierid LIKE '%" + model.TransportSupplierID + "%' OR TransportSupplierName Like '%" + model.TransportSupplierName + "%')  ";
            }
            return(strSql);
        }
コード例 #11
0
ファイル: DepInterface_Func.cs プロジェクト: scgls/jiacheng
        protected override bool CheckModelBeforeSave(T_DepInterfaceInfo model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (model.VoucherName == 0)
            {
                strError = "请先选择单据名称!";
                return(false);
            }

            if (model.VoucherType == 0)
            {
                strError = "请先选择单据类型!";
                return(false);
            }

            if (model.Function == 0)
            {
                strError = "请先选择功能!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.Route))
            {
                strError = "请先输入DLL文件路径!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.ClassName))
            {
                strError = "请先输入类名!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.DLLName))
            {
                strError = "请先输入DLL文件名称!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.FunctionName))
            {
                strError = "请先输入函数名称!";
                return(false);
            }

            return(true);
        }
コード例 #12
0
ファイル: User_Func.cs プロジェクト: NietzscheEdward/jiacheng
        protected override bool CheckModelBeforeSave(UserInfo model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (model.UserStatus <= 0)
            {
                strError = "用户状态必须选择!";
                return(false);
            }

            if (model.UserType <= 0)
            {
                strError = "用户类型必须选择!";
                return(false);
            }


            if (BILBasic.Common.Common_Func.IsNullOrEmpty(model.UserNo))
            {
                strError = "登录名不能为空!";
                return(false);
            }
            if (Common_Func.IsNullOrEmpty(model.UserName))
            {
                strError = "用户姓名不能为空!";
                return(false);
            }
            if (Common_Func.IsNullOrEmpty(model.PassWord) || Common_Func.IsNullOrEmpty(model.RePassword))
            {
                strError = "登陆密码和确认密码不能为空!";
                return(false);
            }

            //if (Common_Func.IsNullOrEmpty(model.GroupCode))
            //{
            //    strError = "用户分组不能为空!";
            //    return false;
            //}
            if (!Common_Func.IsEqualString(model.PassWord, model.RePassword))
            {
                strError = "确认密码与登陆密码不一致!";
                return(false);
            }


            return(true);
        }
コード例 #13
0
        protected override string GetFilterSql(UserModel user, T_HouseInfo model)
        {
            string strSql = " where isnull(isDel,0) != 2";

            string strAnd = " and ";

            if (model.WarehouseID > 0)
            {
                strSql += strAnd;
                strSql += " warehouseid = '" + model.WarehouseID + "'  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.WarehouseNo))
            {
                strSql += strAnd;
                strSql += " (WarehouseNo LIKE '%" + model.WarehouseNo + "%' OR WarehouseName Like '%" + model.WarehouseNo + "%')  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.HouseNo))
            {
                strSql += strAnd;
                //strSql += " ID In (Select WarehouseID From T_House Where HouseNo LIKE '%" + model.HouseNo + "%' OR HouseName Like '%" + model.HouseNo + "%') ";
                strSql += "(HouseNo LIKE '%" + model.HouseNo + "%' OR HouseName Like '%" + model.HouseNo + "%') ";
            }

            if (!Common_Func.IsNullOrEmpty(model.AreaNo))
            {
                strSql += strAnd;
                strSql += " ID In (Select houseid From t_area Where AreaNo LIKE '" + model.AreaNo + "%' OR AreaName Like '" + model.AreaNo + "%') ";
            }

            if (!Common_Func.IsNullOrEmpty(model.Creater))
            {
                strSql += strAnd;
                strSql += " Creater Like '%" + model.Creater + "%' ";
            }

            if (model.DateFrom != null)
            {
                strSql += strAnd;
                strSql += " CreateTime >= " + model.DateFrom.ToDateTime().Date.ToOracleTimeString() + "  ";
            }

            if (model.DateTo != null)
            {
                strSql += strAnd;
                strSql += " CreateTime <= " + model.DateTo.ToDateTime().AddDays(1).Date.ToOracleTimeString() + " ";
            }

            return(strSql);
        }
コード例 #14
0
ファイル: Area_DB.cs プロジェクト: LSALFRED/skcm
        protected override string GetFilterSql(UserModel user, T_AreaInfo model)
        {
            string strSql = " where isnull(isDel,0) != 2";

            string strAnd = " and ";

            if (model.HouseID > 0)
            {
                strSql += strAnd;
                strSql += " HouseID = '" + model.HouseID + "'  ";
            }

            if (!string.IsNullOrEmpty(model.AreaNo))
            {
                strSql += strAnd;
                strSql += " areano like '" + model.AreaNo + "%'  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.WarehouseNo))
            {
                strSql += strAnd;
                strSql += "  (WarehouseNo LIKE '%" + model.WarehouseNo + "%' OR WarehouseName Like '%" + model.WarehouseNo + "%')  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.HouseNo))
            {
                strSql += strAnd;
                strSql += "  (HouseNo LIKE '%" + model.HouseNo + "%' OR HouseName Like '%" + model.HouseNo + "%') ";
            }

            //if (!Common_Func.IsNullOrEmpty(model.Creater))
            //{
            //    strSql += strAnd;
            //    strSql += " Creater Like '%" + model.Creater + "%' ";
            //}

            //if (model.DateFrom != null)
            //{
            //    strSql += strAnd;
            //    strSql += " CreateTime >= " + model.DateFrom.ToDateTime().Date.ToOracleTimeString() + "  ";
            //}

            //if (model.DateTo != null)
            //{
            //    strSql += strAnd;
            //    strSql += " CreateTime <= " + model.DateTo.ToDateTime().AddDays(1).Date.ToOracleTimeString() + " ";
            //}

            return(strSql);
        }
コード例 #15
0
ファイル: AdvInStockDetail_DB.cs プロジェクト: scgls/jiacheng
        protected override string GetFilterSql(UserModel user, T_AdvInStockDetailInfo model)
        {
            string strSql = " where isnull(isDel,0) != 2  ";
            string strAnd = " and ";

            if (!Common_Func.IsNullOrEmpty(model.ErpVoucherNo))
            {
                strSql += strAnd;
                strSql += " ErpVoucherNo like '%" + model.ErpVoucherNo.Trim() + "%' ";
            }

            if (!Common_Func.IsNullOrEmpty(model.IsPrint))
            {
                if (model.IsPrint == "是")
                {
                    strSql += strAnd;
                    strSql += " sumqty > 0";
                }
                if (model.IsPrint == "否")
                {
                    strSql += strAnd;
                    strSql += " sumqty = 0";
                }
            }

            if (!Common_Func.IsNullOrEmpty(model.MaterialNo))
            {
                strSql += strAnd;
                strSql += " MaterialNo like '%" + model.MaterialNo.Trim() + "%' ";
            }

            if (!Common_Func.IsNullOrEmpty(model.Createname))
            {
                strSql += strAnd;
                strSql += " Createname like '%" + model.Createname.Trim() + "%' ";
            }
            if (model.DateFrom != null)
            {
                strSql += strAnd;
                strSql += " CREATETIME>=to_date('" + model.DateFrom.ToDateTime().ToString("yyyy/MM/dd") + "','YYYY/MM/DD') ";
            }
            if (model.DateTo != null)
            {
                strSql += strAnd;
                strSql += " CREATETIME<=to_date('" + model.DateTo.ToDateTime().ToString("yyyy/MM/dd") + "','YYYY/MM/DD')+1 ";
            }


            return(strSql);
        }
コード例 #16
0
ファイル: Warehouse_DB.cs プロジェクト: shew990/TaiBang
        protected override string GetFilterSql(UserModel user, T_WareHouseInfo model)
        {
            string strSql = base.GetFilterSql(user, model);
            string strAnd = " and ";


            if (!Common_Func.IsNullOrEmpty(model.WareHouseNo))
            {
                strSql += strAnd;
                strSql += " (WarehouseNo LIKE '" + model.WareHouseNo + "%' OR WarehouseName Like '" + model.WareHouseNo + "%')  ";
            }

            if (!Common_Func.IsNullOrEmpty(model.WareHouseName))
            {
                strSql += strAnd;
                strSql += "  WarehouseName Like '" + model.WareHouseName + "%'  ";
            }

            if (!string.IsNullOrEmpty(model.HouseNo))
            {
                strSql += strAnd;
                strSql += " ID In (Select WarehouseID From T_House Where HouseNo LIKE '%" + model.HouseNo + "%' OR HouseName Like '%" + model.HouseNo + "%') ";
            }

            if (!Common_Func.IsNullOrEmpty(model.Address))
            {
                strSql += strAnd;
                strSql += " Address Like '%" + model.Address + "%'";
            }

            if (!Common_Func.IsNullOrEmpty(model.Creater))
            {
                strSql += strAnd;
                strSql += " Creater Like '%" + model.Creater + "%' ";
            }

            if (model.DateFrom != null)
            {
                strSql += strAnd;
                strSql += " CreateTime >= " + model.DateFrom.ToDateTime().Date.ToOracleTimeString() + "  ";
            }

            if (model.DateTo != null)
            {
                strSql += strAnd;
                strSql += " CreateTime <= " + model.DateTo.ToDateTime().AddDays(1).Date.ToOracleTimeString() + " ";
            }

            return(strSql);
        }
コード例 #17
0
        protected override string GetFilterSql(UserModel user, MaterialPack_Model model)
        {
            string strSql = string.Empty;
            string strAnd = " and ";

            strSql += base.GetFilterSql(user, model);
            if (!Common_Func.IsNullOrEmpty(model.WATERCODE))
            {
                strSql += strAnd;
                strSql += " (WATERCODE = '" + model.WATERCODE + "' ) ";
            }

            if (!Common_Func.IsNullOrEmpty(model.StrongHoldCode))
            {
                strSql += strAnd;
                strSql += " (StrongHoldCode = '" + model.StrongHoldCode + "' ) ";
            }
            return(strSql);
        }
コード例 #18
0
ファイル: MouldType_DB.cs プロジェクト: shew990/TaiBang
        protected override string GetFilterSql(UserModel user, T_MouldType customer)
        {
            string strSql = " where 1=1  ";
            string strAnd = " and ";

            if (!Common_Func.IsNullOrEmpty(customer.MouldTypeCode))
            {
                strSql += strAnd;
                strSql += " (ID like '%" + customer.MouldTypeCode + "%')  ";
            }


            if (!string.IsNullOrEmpty(customer.MouldTypeName))
            {
                strSql += strAnd;
                strSql += " Name like '%" + customer.MouldTypeName + "%'";
            }

            return(strSql);
        }
コード例 #19
0
        protected override bool CheckModelBeforeSave(T_Team model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.teamCode))
            {
                strError = "班组编号不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.teamName))
            {
                strError = "班组名称不能为空!";
                return(false);
            }
            return(true);
        }
コード例 #20
0
        protected override bool CheckModelBeforeSave(T_CustomerAddressInfo model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.ContactPerson))
            {
                strError = "联系人不能为空!";
                return(false);
            }
            if (Common_Func.IsNullOrEmpty(model.Address))
            {
                strError = "地址不能为空!";
                return(false);
            }

            return(true);
        }
コード例 #21
0
ファイル: MouldType_Func.cs プロジェクト: scgls/jiacheng
        protected override bool CheckModelBeforeSave(T_MouldType model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.MouldTypeCode))
            {
                strError = "模具型号编号不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.MouldTypeName))
            {
                strError = "模具型号名称不能为空!";
                return(false);
            }
            return(true);
        }
コード例 #22
0
ファイル: Machine_Func.cs プロジェクト: shew990/TaiBang
        protected override bool CheckModelBeforeSave(T_Machine model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.Sn))
            {
                strError = "设备编号不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.MachineName))
            {
                strError = "设备名称不能为空!";
                return(false);
            }
            return(true);
        }
コード例 #23
0
ファイル: Customer_Func.cs プロジェクト: scgls/jiacheng
        protected override bool CheckModelBeforeSave(T_CustomerInfo model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.CustomerNo))
            {
                strError = "客户编号不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.CustomerName))
            {
                strError = "客户名称不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.CustomerAbridge))
            {
                strError = "客户简称不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.EnglishName))
            {
                strError = "英文名不能为空!";
                return(false);
            }

            if (Common_Func.IsNullOrEmpty(model.ContactPerson))
            {
                strError = "联系人不能为空!";
                return(false);
            }

            return(true);
        }
コード例 #24
0
        protected override bool CheckModelBeforeSave(UserInfo model, ref string strError)
        {
            if (model == null)
            {
                strError = "客户端传来的实体类不能为空!";
                return(false);
            }

            if (model.UserStatus <= 0)
            {
                strError = "用户状态必须选择!";
                return(false);
            }

            if (model.UserType <= 0)
            {
                strError = "用户类型必须选择!";
                return(false);
            }


            if (BILBasic.Common.Common_Func.IsNullOrEmpty(model.UserNo))
            {
                strError = "登录名不能为空!";
                return(false);
            }
            if (Common_Func.IsNullOrEmpty(model.UserName))
            {
                strError = "用户姓名不能为空!";
                return(false);
            }
            if (Common_Func.IsNullOrEmpty(model.PassWord) || Common_Func.IsNullOrEmpty(model.RePassword))
            {
                strError = "登陆密码和确认密码不能为空!";
                return(false);
            }
            //判断据点和仓库的关系
            T_WareHouse_Func Wfunc = new T_WareHouse_Func();
            string           Msg   = "";

            string[] warehousenos = model.WarehouseCode.Split(',');
            for (int i = 0; i < warehousenos.Length; i++)
            {
                T_WareHouseInfo warehouse = new T_WareHouseInfo()
                {
                    ID = Convert.ToInt16(warehousenos[i])
                };
                Wfunc.GetModelByID(ref warehouse, ref Msg);
                if (model.StrongHoldCode == "0300")
                {
                    if (warehouse.WareHouseNo.Substring(0, 1) != "G")
                    {
                        strError = "仓库和据点没有对应关系!";
                        return(false);
                    }
                }
                if (model.StrongHoldCode == "0401")
                {
                    if (warehouse.WareHouseNo.Substring(0, 2) != "C1")
                    {
                        strError = "仓库和据点没有对应关系!";
                        return(false);
                    }
                }
                if (model.StrongHoldCode == "0402")
                {
                    if (warehouse.WareHouseNo.Substring(0, 2) != "C2")
                    {
                        strError = "仓库和据点没有对应关系!";
                        return(false);
                    }
                }
                if (model.StrongHoldCode == "0403")
                {
                    if (warehouse.WareHouseNo.Substring(0, 2) != "C3")
                    {
                        strError = "仓库和据点没有对应关系!";
                        return(false);
                    }
                }
            }


            //if (Common_Func.IsNullOrEmpty(model.GroupCode))
            //{
            //    strError = "用户分组不能为空!";
            //    return false;
            //}
            if (!Common_Func.IsEqualString(model.PassWord, model.RePassword))
            {
                strError = "确认密码与登陆密码不一致!";
                return(false);
            }


            return(true);
        }