public Results<string> creatSoftReq(softwareInfo rn,upgrade up)
        {
            Results<string> result = new Results<string>();
            try
            {
                HelperData h = new HelperData();
                rn.userCode = Convert.ToInt16(System.Web.HttpContext.Current.Session["userCode"]);
                rn.deleted = false;
                up.deleted = false;
                Int16 t = h.AddSoftwareInfo(rn);
                if (t != 0)
                {
                    result.IsSuccessfull = true;
                    up.softwareCode = rn.softwareCode;
                    h.AddUpgrade(up);

                }
            }
            catch (Exception error)
            {
                result.IsSuccessfull = false;
                result.Message = error.Message;
            }
            return result;
        }
        public object createUpgrade(upgrade rn)
        {
            Results<string> result = new Results<string>();
            try
            {
                HelperData h = new HelperData();

                rn.deleted = false;
                bool t = h.AddUpgrade(rn);
                if (t )
                {
                    result.IsSuccessfull = true;
                }
            }
            catch (Exception error)
            {
                result.IsSuccessfull = false;
                result.Message = error.Message;
            }
            return result;
        }
 public static string creatSoftUpgradeReq(softwareInfo rn,upgrade up)
 {
     AddSoftwareBLL asb = new AddSoftwareBLL();
     return JsonConvert.SerializeObject(asb.creatSoftReq(rn,up));
 }
 //Edit Upgrade Table
 public int EditUpgrade(upgrade u)
 {
     try
     {
         var v = from i in db.upgrades
                 where i.upgradeCode == u.upgradeCode
                 select i;
         upgrade newupgrade = v.FirstOrDefault();
         if(newupgrade != null)
         {
             newupgrade = u;
             db.SubmitChanges();
             return 1;
         }
         return 0;//not found
     }
     catch (Exception error)
     {
         return -1;
     }
 }
 //Add To Upgrade Table
 public bool AddUpgrade(upgrade u)
 {
     try
     {
         db.upgrades.InsertOnSubmit(u);
         db.SubmitChanges();
         return true;
     }
     catch (Exception error)
     {
         return false;
     }
 }
コード例 #6
0
 partial void Deleteupgrade(upgrade instance);
コード例 #7
0
 partial void Updateupgrade(upgrade instance);
コード例 #8
0
 partial void Insertupgrade(upgrade instance);
コード例 #9
0
		private void detach_upgrades(upgrade entity)
		{
			this.SendPropertyChanging();
			entity.vahedInfo = null;
		}
コード例 #10
0
		private void attach_upgrades(upgrade entity)
		{
			this.SendPropertyChanging();
			entity.softwareInfo = this;
		}
コード例 #11
0
 //Edit Upgrade Table
 public int EditUpgrade(upgrade u)
 {
     try
     {
         var v = from i in db.upgrades
                 where i.softwareCode == u.softwareCode
                 select i;
         upgrade newupgrade = v.FirstOrDefault();
         if (newupgrade != null)
         {
             newupgrade.description = u.description;
             newupgrade.vahedCode = u.vahedCode;
             newupgrade.softwareCode = u.softwareCode;
             newupgrade.deleted = u.deleted;
             newupgrade.upgradeDate = u.upgradeDate;
             db.SubmitChanges();
             return 1;
         }
         return 0;//not found
     }
     catch (Exception error)
     {
         return -1;
     }
 }
コード例 #12
0
        public object updateUpgradeReq(upgrade rn)
        {
            Results<string> result = new Results<string>();
            try
            {
                HelperData h = new HelperData();
                rn.deleted = false;

                int t = h.EditUpgrade(rn);
                if (t != 0)
                {
                    result.IsSuccessfull = true;
                    //  result.Value = rn.softwareCode.ToString();
                }
            }
            catch (Exception error)
            {
                result.IsSuccessfull = false;
                result.Message = error.Message;
            }
            return result;
        }