public bool UpdateRfq(Rfq rfq) { string strSql = string.Format("update rfq set customerName='{0}',partNo='{1}',salesId={2},contact='{3}',project='{4}',rohs={5},phone='{6}',fax='{7}',email='{8}',rfqdate='{9}',priority={10},dockdate='{11}',mfg='{12}',dc='{13}',custPartNo='{14}',genPartNo='{15}',alt='{16}',qty={17},packaging='{18}',targetPrice={19},resale={20},firstPA={21},secondPA={22} where rfqNo={23}", rfq.customerName, rfq.partNo, rfq.salesId, rfq.contact, rfq.project, rfq.rohs, rfq.phone, rfq.fax, rfq.email, rfq.rfqdate.Date.ToShortDateString(), rfq.priority.HasValue?rfq.priority.Value.ToString():"null", rfq.dockdate.Date.ToShortDateString(), rfq.mfg, rfq.dc, rfq.custPartNo, rfq.genPartNo, rfq.alt, rfq.qty, rfq.packaging, rfq.targetPrice.HasValue?rfq.targetPrice.Value.ToString():"null", rfq.resale.HasValue?rfq.resale.Value.ToString():"null", rfq.firstPA.HasValue?rfq.firstPA.Value.ToString():"null", rfq.secondPA.HasValue?rfq.secondPA.Value.ToString():"null", rfq.rfqNo); int row = db.ExecDataBySql(strSql); if (row == 1) { return(true); } else { return(false); } }
public bool SaveRfq(Rfq rfq) { string strSql = string.Format("insert into rfq(customerName,partNo,salesId,contact,project,rohs,phone,fax,email,rfqdate,priority,dockdate,mfg,dc,custPartNo,genPartNo,alt,qty,packaging,targetPrice,resale,cost,firstPA,secondPA,rfqStates,infoToCustomer,infoToInternal,routingHistory) " + " 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}')", rfq.customerName, rfq.partNo, rfq.salesId, rfq.contact, rfq.project, rfq.rohs, rfq.phone, rfq.fax, rfq.email, rfq.rfqdate.Date.ToShortDateString(), rfq.priority.HasValue?rfq.priority.Value.ToString():"null", rfq.dockdate.Date.ToShortDateString(), rfq.mfg, rfq.dc, rfq.custPartNo, rfq.genPartNo, rfq.alt, rfq.qty.HasValue?rfq.qty.Value.ToString():"null", rfq.packaging, rfq.targetPrice.HasValue?rfq.targetPrice.Value.ToString():"null", rfq.resale.HasValue?rfq.resale.Value.ToString():"null", rfq.cost.HasValue?rfq.cost.Value.ToString():"null", rfq.firstPA.HasValue?rfq.firstPA.Value.ToString():"null", rfq.secondPA.HasValue?rfq.secondPA.Value.ToString():"null", rfq.rfqStates, rfq.infoToCustomer, rfq.infoToInternal, rfq.routingHistory ); int row = db.ExecDataBySql(strSql); if (row == 1) { return(true); } else { return(false); } }
public bool UpdateRfq(Rfq rfq) { string strSql=string.Format("update rfq set customerName='{0}',partNo='{1}',salesId={2},contact='{3}',project='{4}',rohs={5},phone='{6}',fax='{7}',email='{8}',rfqdate='{9}',priority={10},dockdate='{11}',mfg='{12}',dc='{13}',custPartNo='{14}',genPartNo='{15}',alt='{16}',qty={17},packaging='{18}',targetPrice={19},resale={20},firstPA={21},secondPA={22} where rfqNo={23}", rfq.customerName,rfq.partNo,rfq.salesId,rfq.contact,rfq.project,rfq.rohs,rfq.phone,rfq.fax,rfq.email,rfq.rfqdate.Date.ToShortDateString(), rfq.priority.HasValue?rfq.priority.Value.ToString():"null",rfq.dockdate.Date.ToShortDateString(),rfq.mfg,rfq.dc,rfq.custPartNo,rfq.genPartNo,rfq.alt,rfq.qty,rfq.packaging, rfq.targetPrice.HasValue?rfq.targetPrice.Value.ToString():"null", rfq.resale.HasValue?rfq.resale.Value.ToString():"null", rfq.firstPA.HasValue?rfq.firstPA.Value.ToString():"null", rfq.secondPA.HasValue?rfq.secondPA.Value.ToString():"null",rfq.rfqNo); int row=db.ExecDataBySql(strSql); if(row==1) return true; else return false; }
public bool SaveRfq(Rfq rfq) { string strSql=string.Format("insert into rfq(customerName,partNo,salesId,contact,project,rohs,phone,fax,email,rfqdate,priority,dockdate,mfg,dc,custPartNo,genPartNo,alt,qty,packaging,targetPrice,resale,cost,firstPA,secondPA,rfqStates,infoToCustomer,infoToInternal,routingHistory) " +" 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}')", rfq.customerName,rfq.partNo,rfq.salesId,rfq.contact,rfq.project,rfq.rohs,rfq.phone,rfq.fax,rfq.email,rfq.rfqdate.Date.ToShortDateString(), rfq.priority.HasValue?rfq.priority.Value.ToString():"null",rfq.dockdate.Date.ToShortDateString(),rfq.mfg,rfq.dc,rfq.custPartNo,rfq.genPartNo,rfq.alt, rfq.qty.HasValue?rfq.qty.Value.ToString():"null",rfq.packaging,rfq.targetPrice.HasValue?rfq.targetPrice.Value.ToString():"null", rfq.resale.HasValue?rfq.resale.Value.ToString():"null",rfq.cost.HasValue?rfq.cost.Value.ToString():"null", rfq.firstPA.HasValue?rfq.firstPA.Value.ToString():"null",rfq.secondPA.HasValue?rfq.secondPA.Value.ToString():"null",rfq.rfqStates,rfq.infoToCustomer,rfq.infoToInternal,rfq.routingHistory ); int row=db.ExecDataBySql(strSql); if(row==1) return true; else return false; }
public Rfq GetRfqAccordingToRfqId(int rfqId) { string strSql = string.Format("select * from rfq where rfqNo={0}", rfqId); DataTable dt = db.GetDataTable(strSql, "tempTable"); DataRow dr = dt.Rows[0]; Rfq rfq = new Rfq(); rfq.customerName=dr["customerName"].ToString(); rfq.partNo=dr["partNo"].ToString(); rfq.salesId=Convert.ToInt32(dr["salesId"]); rfq.contact=dr["contact"].ToString(); rfq.project=dr["project"].ToString(); rfq.rohs=Convert.ToInt32(dr["rohs"]); rfq.phone=dr["phone"].ToString(); rfq.fax=dr["fax"].ToString(); rfq.email=dr["email"].ToString(); rfq.rfqdate=Convert.ToDateTime(dr["rfqdate"]); if(dr["priority"]==DBNull.Value) { rfq.priority=null; } else { rfq.priority=Convert.ToInt32(dr["priority"]); } rfq.dockdate=Convert.ToDateTime(dr["dockdate"]); rfq.mfg=dr["mfg"].ToString(); rfq.dc=dr["dc"].ToString(); rfq.custPartNo=dr["custPartNo"].ToString(); rfq.genPartNo=dr["genPartNo"].ToString(); rfq.alt=dr["alt"].ToString(); if(dr["qty"]==DBNull.Value) rfq.qty=null; else rfq.qty=Convert.ToInt32(dr["qty"]); rfq.packaging=dr["packaging"].ToString(); if(dr["targetPrice"]==DBNull.Value) rfq.targetPrice=null; else rfq.targetPrice=Convert.ToSingle(dr["targetPrice"]); if(dr["cost"]==DBNull.Value) rfq.cost=null; else rfq.cost=Convert.ToSingle(dr["cost"]); if(dr["resale"]==DBNull.Value) rfq.resale=null; else rfq.resale=Convert.ToSingle(dr["resale"]); if(dr["firstPA"]==DBNull.Value) rfq.firstPA=null; else rfq.firstPA=Convert.ToInt32(dr["firstPA"]); if(dr["secondPA"]==DBNull.Value) rfq.secondPA=null; else rfq.secondPA=Convert.ToInt32(dr["secondPA"]); rfq.rfqStates=Convert.ToInt32(dr["rfqStates"]); rfq.infoToCustomer=dr["infoToCustomer"].ToString(); rfq.infoToInternal=dr["infoToInternal"].ToString(); rfq.routingHistory=dr["routingHistory"].ToString(); if (dr["closeReason"] == DBNull.Value) rfq.closeReason = null; else rfq.closeReason = Convert.ToInt32(dr["closeReason"]); return rfq; }
public Rfq GetRfqAccordingToRfqId(int rfqId) { string strSql = string.Format("select * from rfq where rfqNo={0}", rfqId); DataTable dt = db.GetDataTable(strSql, "tempTable"); DataRow dr = dt.Rows[0]; Rfq rfq = new Rfq(); rfq.customerName = dr["customerName"].ToString(); rfq.partNo = dr["partNo"].ToString(); rfq.salesId = Convert.ToInt32(dr["salesId"]); rfq.contact = dr["contact"].ToString(); rfq.project = dr["project"].ToString(); rfq.rohs = Convert.ToInt32(dr["rohs"]); rfq.phone = dr["phone"].ToString(); rfq.fax = dr["fax"].ToString(); rfq.email = dr["email"].ToString(); rfq.rfqdate = Convert.ToDateTime(dr["rfqdate"]); if (dr["priority"] == DBNull.Value) { rfq.priority = null; } else { rfq.priority = Convert.ToInt32(dr["priority"]); } rfq.dockdate = Convert.ToDateTime(dr["dockdate"]); rfq.mfg = dr["mfg"].ToString(); rfq.dc = dr["dc"].ToString(); rfq.custPartNo = dr["custPartNo"].ToString(); rfq.genPartNo = dr["genPartNo"].ToString(); rfq.alt = dr["alt"].ToString(); if (dr["qty"] == DBNull.Value) { rfq.qty = null; } else { rfq.qty = Convert.ToInt32(dr["qty"]); } rfq.packaging = dr["packaging"].ToString(); if (dr["targetPrice"] == DBNull.Value) { rfq.targetPrice = null; } else { rfq.targetPrice = Convert.ToSingle(dr["targetPrice"]); } if (dr["cost"] == DBNull.Value) { rfq.cost = null; } else { rfq.cost = Convert.ToSingle(dr["cost"]); } if (dr["resale"] == DBNull.Value) { rfq.resale = null; } else { rfq.resale = Convert.ToSingle(dr["resale"]); } if (dr["firstPA"] == DBNull.Value) { rfq.firstPA = null; } else { rfq.firstPA = Convert.ToInt32(dr["firstPA"]); } if (dr["secondPA"] == DBNull.Value) { rfq.secondPA = null; } else { rfq.secondPA = Convert.ToInt32(dr["secondPA"]); } rfq.rfqStates = Convert.ToInt32(dr["rfqStates"]); rfq.infoToCustomer = dr["infoToCustomer"].ToString(); rfq.infoToInternal = dr["infoToInternal"].ToString(); rfq.routingHistory = dr["routingHistory"].ToString(); if (dr["closeReason"] == DBNull.Value) { rfq.closeReason = null; } else { rfq.closeReason = Convert.ToInt32(dr["closeReason"]); } return(rfq); }