Beispiel #1
0
        private T_SupplyDemand GetModel(HttpContext context)
        {
            T_SupplyDemand model = new T_SupplyDemand();

            try { model.Id = int.Parse(context.Request.Form["Id"].ToString()); }
            catch { }
            try {
                //会员添加id
                if (context.Session["userinfoid"] != null)
                {
                    model.UserInfoId = int.Parse(context.Session["userinfoid"].ToString());
                }
                else
                {
                    model.UserInfoId = admin.Id;
                }
            }
            catch { }
            try { model.SupplyOrDemand = int.Parse(context.Request.Form["rSupplyOrDemand"].ToString()); }
            catch { }
            model.ProName       = context.Request.Form["ProName"].ToString();
            model.KeyWord       = context.Request.Form["KeyWord"].ToString();
            model.ProNum        = context.Request.Form["ProNum"].ToString();
            model.dName         = context.Request.Form["dName"].ToString();
            model.dGlebePurpose = context.Request.Form["dGlebePurpose"].ToString();
            try { model.dListingDate = DateTime.Parse(context.Request.Form["dListingDate"].ToString()); }
            catch { }
            model.dArea           = context.Request.Form["dArea"].ToString();
            model.dQuotation      = context.Request.Form["dQuotation"].ToString();
            model.dcirculation    = context.Request.Form["dcirculation"].ToString();
            model.dDeadline       = context.Request.Form["dDeadline"].ToString();
            model.dCenterContact  = context.Request.Form["dCenterContact"].ToString();
            model.dProContact     = context.Request.Form["dProContact"].ToString();
            model.sName           = context.Request.Form["sName"].ToString();
            model.sLandProperties = context.Request.Form["sLandProperties"].ToString();
            model.sOther          = context.Request.Form["sOther"].ToString();
            model.sLocated        = context.Request.Form["sLocated"].ToString();
            model.sOutArea        = context.Request.Form["sOutArea"].ToString();
            model.sDeadline       = context.Request.Form["sDeadline"].ToString();
            model.sOutWay         = context.Request.Form["sOutWay"].ToString();
            try { model.sListedData = DateTime.Parse(context.Request.Form["sListedData"].ToString()); }
            catch { }
            model.sOutAgain      = context.Request.Form["sOutAgain"].ToString();
            model.sTransactions  = context.Request.Form["sTransactions"].ToString();
            model.sIsMorSeal     = context.Request.Form["sIsMorSeal"].ToString();
            model.sListingPrice  = context.Request.Form["sListingPrice"].ToString();
            model.sCenterContact = context.Request.Form["sCenterContact"].ToString();
            model.sProContact    = context.Request.Form["sProContact"].ToString();
            model.sSettlement    = context.Request.Form["sSettlement"].ToString();
            try
            {
                model.IsCheck = admin.IsCheck;
            }
            catch { model.IsCheck = 1; }
            model.Remark = context.Request.Form["Remark"].ToString();
            return(model);
        }
Beispiel #2
0
 public T_SupplyDemand GetModel(int id)
 {
     try
     {
         T_SupplyDemand model  = new T_SupplyDemand();
         string         strSql = string.Format("select Id,UserInfoId,SupplyOrDemand,ProName,KeyWord,ProNum,dName,dGlebePurpose,dListingDate,dArea,dQuotation,dcirculation,dDeadline,dCenterContact,dProContact,sName,sLandProperties,sOther,sLocated,sOutArea,sDeadline,sOutWay,sListedData,sOutAgain,sTransactions,sIsMorSeal,sListingPrice,sCenterContact,sProContact,sSettlement,IsCheck,CreateDate,Remark from T_SupplyDemand  where Id={0}", id);
         using (dynamic read = DbHelper.Factory().ExecuteReader(strSql))
         {
             if (read.Read())
             {
                 #region
                 model.Id              = int.Parse(read["Id"].ToString());
                 model.UserInfoId      = int.Parse(read["UserInfoId"].ToString());
                 model.SupplyOrDemand  = int.Parse(read["SupplyOrDemand"].ToString());
                 model.ProName         = read["ProName"].ToString();
                 model.KeyWord         = read["KeyWord"].ToString();
                 model.ProNum          = read["ProNum"].ToString();
                 model.dName           = read["dName"].ToString();
                 model.dGlebePurpose   = read["dGlebePurpose"].ToString();
                 model.dListingDate    = DateTime.Parse(read["dListingDate"].ToString());
                 model.dArea           = read["dArea"].ToString();
                 model.dQuotation      = read["dQuotation"].ToString();
                 model.dcirculation    = read["dcirculation"].ToString();
                 model.dDeadline       = read["dDeadline"].ToString();
                 model.dCenterContact  = read["dCenterContact"].ToString();
                 model.dProContact     = read["dProContact"].ToString();
                 model.sName           = read["sName"].ToString();
                 model.sLandProperties = read["sLandProperties"].ToString();
                 model.sOther          = read["sOther"].ToString();
                 model.sLocated        = read["sLocated"].ToString();
                 model.sOutArea        = read["sOutArea"].ToString();
                 model.sDeadline       = read["sDeadline"].ToString();
                 model.sOutWay         = read["sOutWay"].ToString();
                 model.sListedData     = DateTime.Parse(read["sListedData"].ToString());
                 model.sOutAgain       = read["sOutAgain"].ToString();
                 model.sTransactions   = read["sTransactions"].ToString();
                 model.sIsMorSeal      = read["sIsMorSeal"].ToString();
                 model.sListingPrice   = read["sListingPrice"].ToString();
                 model.sCenterContact  = read["sCenterContact"].ToString();
                 model.sProContact     = read["sProContact"].ToString();
                 model.sSettlement     = read["sSettlement"].ToString();
                 model.IsCheck         = int.Parse(read["IsCheck"].ToString());
                 model.CreateDate      = DateTime.Parse(read["CreateDate"].ToString());
                 model.Remark          = read["Remark"].ToString();
                 #endregion
             }
             read.Dispose();
         }
         return(model);
     }
     catch
     {
         throw;
     }
 }
Beispiel #3
0
 private string Update(T_SupplyDemand model)
 {
     if (dal.Update(model))
     {
         return("供应需求信息修改成功!");
     }
     else
     {
         return("供应需求信息修改失败,错误代码:500 ");
     }
 }
Beispiel #4
0
 private string Create(T_SupplyDemand model)
 {
     if (dal.Create(model))
     {
         return("供应需求信息添加成功!");
     }
     else
     {
         return("供应需求信息添加失败,错误代码:500 ");
     }
 }
Beispiel #5
0
 public bool Update(T_SupplyDemand model)
 {
     try
     {
         object[] obj    = { model.UserInfoId, model.SupplyOrDemand, model.ProName, model.KeyWord, model.ProNum, model.dName, model.dGlebePurpose, model.dListingDate.ToString("yyyy-MM-dd HH:mm:ss"), model.dArea, model.dQuotation, model.dcirculation, model.dDeadline, model.dCenterContact, model.dProContact, model.sName, model.sLandProperties, model.sOther, model.sLocated, model.sOutArea, model.sDeadline, model.sOutWay, model.sListedData.ToString("yyyy-MM-dd HH:mm:ss"), model.sOutAgain, model.sTransactions, model.sIsMorSeal, model.sListingPrice, model.sCenterContact, model.sProContact, model.sSettlement, model.IsCheck, model.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), model.Remark, model.Id };
         string   strSql = string.Format("update T_SupplyDemand set UserInfoId={0},SupplyOrDemand={1},ProName='{2}',KeyWord='{3}',ProNum='{4}',dName='{5}',dGlebePurpose='{6}',dListingDate='{7}',dArea='{8}',dQuotation='{9}',dcirculation='{10}',dDeadline='{11}',dCenterContact='{12}',dProContact='{13}',sName='{14}',sLandProperties='{15}',sOther='{16}',sLocated='{17}',sOutArea='{18}',sDeadline='{19}',sOutWay='{20}',sListedData='{21}',sOutAgain='{22}',sTransactions='{23}',sIsMorSeal='{24}',sListingPrice='{25}',sCenterContact='{26}',sProContact='{27}',sSettlement='{28}',IsCheck={29},CreateDate='{30}',Remark='{31}' where Id ={32}", obj);
         if (DbHelper.Factory().ExecuteNonQuery(strSql) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { return(false); }
 }
Beispiel #6
0
 public bool Create(T_SupplyDemand model)
 {
     try
     {
         object[] obj    = { model.UserInfoId, model.SupplyOrDemand, model.ProName, model.KeyWord, model.ProNum, model.dName, model.dGlebePurpose, model.dListingDate.ToString("yyyy-MM-dd HH:mm:ss"), model.dArea, model.dQuotation, model.dcirculation, model.dDeadline, model.dCenterContact, model.dProContact, model.sName, model.sLandProperties, model.sOther, model.sLocated, model.sOutArea, model.sDeadline, model.sOutWay, model.sListedData.ToString("yyyy-MM-dd HH:mm:ss"), model.sOutAgain, model.sTransactions, model.sIsMorSeal, model.sListingPrice, model.sCenterContact, model.sProContact, model.sSettlement, model.IsCheck, model.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), model.Remark };
         string   strSql = string.Format("insert into T_SupplyDemand (UserInfoId,SupplyOrDemand,ProName,KeyWord,ProNum,dName,dGlebePurpose,dListingDate,dArea,dQuotation,dcirculation,dDeadline,dCenterContact,dProContact,sName,sLandProperties,sOther,sLocated,sOutArea,sDeadline,sOutWay,sListedData,sOutAgain,sTransactions,sIsMorSeal,sListingPrice,sCenterContact,sProContact,sSettlement,IsCheck,CreateDate,Remark) values ({0},{1},'{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}',{29},'{30}','{31}')", obj);
         if (DbHelper.Factory().ExecuteNonQuery(strSql) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { return(false); }
 }