Пример #1
0
 /// <summary>
 /// 添加一个租借的记录
 /// 返回 true 表示成功,否侧该记录已存在
 /// </summary>
 /// <param name="_rent"></param>
 /// <returns></returns>
 public bool AddData(Renting_Management_System.Models.RentMod _rent)
 {
     rent = new Renting_Management_System.Models.RentMod();
     rent =SelectBy_CustomerID_N_ImageID(_rent.CustomerID, _rent.ImageID);
     if (rent == null)
     {
         StringBuilder insertStr = new StringBuilder();
         insertStr.Append("Insert Into [Rent](影像编号,客户编号,用户编号,出租数量,出租日期,归还日期,出租押金,归还状态,描述)");
         insertStr.Append("Values ('");
         insertStr.Append(_rent.ImageID + "','");
         insertStr.Append(_rent.CustomerID + "','");
         insertStr.Append(_rent.UserID + "',");
         insertStr.Append(_rent.QuantityOfRent + ",'");
         insertStr.Append(_rent.RentDate.ToShortDateString() + "','");
         insertStr.Append(_rent.ReturnDate.ToShortDateString() + "',");
         insertStr.Append(_rent.Deposit + ",'");
         insertStr.Append(_rent.ReturnState + "','");
         insertStr.Append(_rent.Description + "'");
         da = new DBConnection();
         da.InsertQuery(insertStr.ToString());
         return true;
     }
     else
     {
         return false;
     }
 }
Пример #2
0
 /// <summary>
 /// 添加一个客户
 /// 返回 true 表示成功,否侧数据已存在
 /// </summary>
 /// <param name="_customer"></param>
 /// <returns></returns>
 public bool AddData(Renting_Management_System.Models.CustomerMod _customer)
 {
     customer = new Renting_Management_System.Models.CustomerMod();
     customer = SelectByID(_customer.CustomerID);
     if (customer == null)
     {
         StringBuilder insertStr = new StringBuilder();
         insertStr.Append("Insert Into [Customer]");
         insertStr.Append("(客户编号,客户类代码,客户名称,性别,出生日期,证件类代码,证件号码,客户地址,联系方式,客户状态,客户描述,客户拒绝)");
         insertStr.Append("Values ('");
         insertStr.Append(_customer.CustomerID + "','");
         insertStr.Append(_customer.CustomerTypeCode + "','");
         insertStr.Append(_customer.CustomerName + "','");
         insertStr.Append(_customer.Sex + "','");
         insertStr.Append(_customer.BirthDate.ToShortDateString() + "','");
         insertStr.Append(_customer.CertificateTypeCode + "','");
         insertStr.Append(_customer.CertificateNumber + "','");
         insertStr.Append(_customer.CustomerAddress + "','");
         insertStr.Append(_customer.CustomerContact + "','");
         insertStr.Append(_customer.CustomerState + "','");
         insertStr.Append(_customer.CustomerDescription + "','");
         insertStr.Append(_customer.CustomerDeny.ToString());
         insertStr.Append("')");
         da = new DBConnection();
         da.InsertQuery(insertStr.ToString());
         return true;
     }
     else
     { return false; }
 }
Пример #3
0
 /// <summary>
 /// 添加一个影像的信息
 /// 返回 true 表示成功,否侧该影像已存在
 /// </summary>
 /// <param name="_image"></param>
 /// <returns></returns>
 public bool AddData(Renting_Management_System.Models.ImageMod _image)
 {
     image = new Renting_Management_System.Models.ImageMod();
     image = SelectByID(_image.ImageID);
     if (image != null)
     { return false; }
     else
     {
         StringBuilder insertStr = new StringBuilder();
         insertStr.Append("Insert Into [Image] (影像编号,影像名称,用户编号,影类代码,地点代码,影像原价,影像租价,库存数量,货架号,出租状态,影像描述) ");
         insertStr.Append("Values ('");
         insertStr.Append(_image.ImageID + "','");
         insertStr.Append(_image.ImageName + "','");
         insertStr.Append(_image.UserID + "','");
         insertStr.Append(_image.ImageTypeCode + "','");
         insertStr.Append(_image.LocalCode + "',");
         insertStr.Append(_image.ImageCostPrice + ",");
         insertStr.Append(_image.ImageRentalPrice + ",");
         insertStr.Append(_image.StorageQuantity + ",'");
         insertStr.Append(_image.ShelvesNumber + "','");
         insertStr.Append(_image.RentState + "','");
         insertStr.Append(_image.ImageDescription);
         insertStr.Append("')");
         da = new DBConnection();
         da.InsertQuery(insertStr.ToString());
         return true;
     }
 }
Пример #4
0
 /// <summary>
 /// 添加一个用户
 /// 返回 true 表示成功
 /// 返回 false 表示该数据已存在
 /// </summary>
 /// <param name="_user"></param>
 /// <returns></returns>
 public bool AddData(Renting_Management_System.Models.UserMod _user)
 {
     user = new Renting_Management_System.Models.UserMod();
     user = SelectByID(_user.UserID);
     if (user == null)
     {
         StringBuilder insertStr = new StringBuilder();
         insertStr.Append("Insert Into [User] ");
         insertStr.Append("(用户编号,用户名称,性别,出生日期,用户密码,用户类代码,证件类代码,证件号码,联系方式,用户地址,用户描述,用户拒绝)");
         insertStr.Append(" Values ('");
         insertStr.Append(_user.UserID + "','");
         insertStr.Append(_user.UserName + "','");
         insertStr.Append(_user.Sex + "','");
         insertStr.Append(_user.BirthDate.Date.ToShortDateString()+ "','");
         insertStr.Append(_user.UserPassword + "','");
         insertStr.Append(_user.UserTypeCode + "','");
         insertStr.Append(_user.CertificateTypeCode + "','");
         insertStr.Append(_user.CertificateNumber + "','");
         insertStr.Append(_user.UserContact + "','");
         insertStr.Append(_user.UserAddress + "','");
         insertStr.Append(_user.UserDescription + "','");
         insertStr.Append(_user.UserDeny.ToString());
         insertStr.Append("')");
         da = new DBConnection();
         da.InsertQuery(insertStr.ToString());
         return true;
     }
     else
     { return false; }
 }
 /// <summary>
 /// 添加一个影类
 /// 返回 true 表示成功
 /// 返回 false 表示数据已存在
 /// </summary>
 /// <param name="uType"></param>
 /// <returns></returns>
 public bool AddData(Renting_Management_System.Models.ImageTypeMod _imageType)
 {
     type = new Renting_Management_System.Models.ImageTypeMod();
     type = SelectData(_imageType.ImageTypeCode);
     if (type == null)
     {
         da = new DBConnection();
         StringBuilder insertStr = new StringBuilder();
         insertStr.Append("Insert Into [ImageType] (影类代码,影类名称) ");
         insertStr.Append("Values ('");
         insertStr.Append(_imageType.ImageTypeCode + "','");
         insertStr.Append(_imageType.ImageTypeName);
         insertStr.Append("')");
         da.InsertQuery(insertStr.ToString());
         return true;
     }
     else
         return false;
 }
Пример #6
0
 /// <summary>
 /// 添加一个地点
 /// 返回 true 表示成功
 /// 返回 false 表示数据已存在
 /// </summary>
 /// <param name="_local"></param>
 /// <returns></returns>
 public bool AddData(Renting_Management_System.Models.LocalMod _local)
 {
     local = new Renting_Management_System.Models.LocalMod();
     local = SelectData(_local.LocalCode);
     if (local == null)
     {
         da = new DBConnection();
         StringBuilder insertStr = new StringBuilder();
         insertStr.Append("Insert Into [Local] (地点代码,地点名称) ");
         insertStr.Append("Values ('");
         insertStr.Append(_local.LocalCode + "','");
         insertStr.Append(_local.LocalName);
         insertStr.Append("')");
         da.InsertQuery(insertStr.ToString());
         return true;
     }
     else
         return false;
 }