/// <summary> /// 修改仓库信息 /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <param name="contacts"></param> /// <param name="phone"></param> /// <param name="address"></param> /// <param name="note"></param> /// <returns></returns> public string SaveWareHouse(string id, string name, string contacts, string phone, string address, string note) { SqlParameter[] par = new SqlParameter[] { new SqlParameter("SName", name), new SqlParameter("SContacts", contacts), new SqlParameter("SPhone", phone), new SqlParameter("SAddress", address), new SqlParameter("WUpdatedate", DateTime.Now), new SqlParameter("SNote", note), new SqlParameter("WDelete", '0'), }; string UpSql = @" UPDATE [WareHouse] SET [WareHouseAddress] =@SAddress ,[WDelete] =@WDelete ,[WHContacts] = @SContacts ,[WHPhone] = @SPhone ,[WareName] = @SName ,[WUpdatedate] =@WUpdatedate ,[WNote] = @SNote WHERE Depotid=" + id + ""; int count = Com.ExecutionSqlPar(UpSql, par); if (count > 0) { return(Utils.GetResult(200, "保存成功", "true")); } else { return(Utils.GetResult(300, "修改失败")); } }
/// <summary> /// 添加用户信息 /// </summary> /// <param name="name"></param> /// <param name="pwd"></param> /// <param name="loginname"></param> /// <param name="email"></param> /// <param name="phone"></param> /// <param name="Deportid"></param> /// <param name="Node"></param> /// <returns></returns> public string AddUsers(string loginname, string username, string email, string phone, string Deportid, string Note) { string SelLogin = "******" + loginname + "' and UDelete=0"; Dictionary <string, object> dic = Common.CommonClass.Select(SelLogin); if (dic == null) { SqlParameter[] par; par = new SqlParameter[] { new SqlParameter("LoginName", loginname), new SqlParameter("Upwd", "123456"), new SqlParameter("username", username), new SqlParameter("Email", email), new SqlParameter("Phone", phone), new SqlParameter("Deportid", Deportid), new SqlParameter("Note", Note), new SqlParameter("UCreateTime", DateTime.Now), new SqlParameter("UDelete", "0"), }; string AddSql = @"INSERT INTO [Users] ([UserName] ,[LoginName] ,[UCreateTime] ,[UPhone] ,[UEmail] ,[UDelete] ,[Upwd] ,[UDepartId] ,[UNote]) VALUES (@userName,@LoginName,@UCreateTime,@Phone,@Email,@UDelete,@Upwd,@Deportid,@Note)"; int count = Com.ExecutionSqlPar(AddSql, par); if (count > 0) { return(Utils.GetResult(200, "添加成功", "true")); } else { return(Utils.GetResult(300, "添加失败")); } } else { return(Utils.GetResult(300, "此用户名被占用")); } }
/// <summary> /// 添加单位名称 /// </summary> /// <param name="unitname"></param> /// <returns></returns> public string AddUnit(string unitname) { string SelName = "select Unitid,UnitName,UnitDelete from Unit where UnitName='" + unitname + "' and UnitDelete=0"; Dictionary <string, object> dic = Common.CommonClass.Select(SelName); if (dic != null) { return(Utils.GetResult(300, "单位名称已存在,请重新添加新的单位名称")); } else { SqlParameter[] par = new SqlParameter[] { new SqlParameter("UnitName", unitname), new SqlParameter("UnitDelete", "0") }; string InsertSql = @"INSERT INTO [Unit]([UnitName],[UnitDelete])VALUES(@UnitName,@UnitDelete)"; int count = Com.ExecutionSqlPar(InsertSql, par); if (count > 0) { return(Utils.GetResult(200, "添加成功", "true")); } else { return(Utils.GetResult(300, "添加失败")); } } }
/// <summary> /// 添加客户信息 /// </summary> /// <param name="NO"></param> /// <param name="Name"></param> /// <param name="Comtel"></param> /// <param name="Money"></param> /// <param name="Phone"></param> /// <param name="Email"></param> /// <param name="Note"></param> /// <returns></returns> public string Insert_AccountInfo(string NO, string Name, string Comtel, string Money, string Phone, string Email, string Note) { SqlParameter[] par = new SqlParameter[] { new SqlParameter("AccountNo", NO), new SqlParameter("AccountName", Name), new SqlParameter("AccountComtel", Comtel), new SqlParameter("AccountMoney", Money), new SqlParameter("AccountPhone", Phone), new SqlParameter("AccountEmail", Email), new SqlParameter("AccountNote", Note), new SqlParameter("AccountCreate", DateTime.Now), new SqlParameter("AccountDelete", "0"), }; string AddAccountInfo = @"INSERT INTO [dbo].[Account]([AccountNo],[AccountName],[AccountMoney],[AccountComTel],[AccountPhone],[AccountEmail],[AccountNote],[AccountCreate],[AccountDelete]) VALUES(@AccountNo,@AccountName, @AccountMoney,@AccountComtel,@AccountPhone,@AccountEmail,@AccountNote,@AccountCreate, @AccountDelete)"; int count = int.Parse(com.ExecutionSqlPar(AddAccountInfo, par).ToString()); if (count > 0) { return(Utils.GetResult(200, "保存成功", "true")); } else { return(Utils.GetResult(400, "保存失败")); } }