public void GetAggreAPIDetailByID(long APIID) { iCompanySetupClient aggregator = new iCompanySetupClient(); CustomProfile profile = CustomProfile.GetProfile(); mAgreegatorAPI aggreAPI = new mAgreegatorAPI(); aggreAPI = aggregator.GetAggreegatorAPIbyID(APIID, profile.DBConnection._constr); if (aggreAPI.AgreegatorID != null) { hdnselectedAggID.Value = aggreAPI.AgreegatorID.ToString(); } if (aggreAPI.APIName != null) { txtapi.Text = aggreAPI.APIName.ToString(); } if (aggreAPI.Purpose != null) { txtpurpose.Text = aggreAPI.Purpose.ToString(); } if (aggreAPI.InputParameter != null) { txtinputpara.Text = aggreAPI.InputParameter.ToString(); } if (aggreAPI.OutputParameter != null) { txtoutputpara.Text = aggreAPI.OutputParameter.ToString(); } if (aggreAPI.APIURL != null) { txturl.Text = aggreAPI.APIURL.ToString(); } if (aggreAPI.Remark != null) { txtremark.Text = aggreAPI.Remark.ToString(); } if (aggreAPI.CompanyID != null) { hdnCompanyid.Value = aggreAPI.CompanyID.ToString(); } if (aggreAPI.CustomerID != null) { hdncustomerid.Value = aggreAPI.CustomerID.ToString(); } if (aggreAPI.Active == "No") { rbtnActiveNo.Checked = true; } }
public static string WMSaveAPIDetail(object objCon, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iCompanySetupClient aggregator = new iCompanySetupClient(); mAgreegatorAPI AgreAPI = new mAgreegatorAPI(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objCon; AgreAPI.AgreegatorID = long.Parse(dictionary["AggregatorID"].ToString()); AgreAPI.APIName = dictionary["APIName"].ToString(); AgreAPI.Purpose = dictionary["Purpose"].ToString(); AgreAPI.InputParameter = dictionary["InputPara"].ToString(); AgreAPI.OutputParameter = dictionary["OutPutPara"].ToString(); AgreAPI.APIURL = dictionary["ApiURL"].ToString(); AgreAPI.Remark = dictionary["Remark"].ToString(); AgreAPI.Active = dictionary["Active"].ToString(); AgreAPI.CompanyID = long.Parse(dictionary["CompanyID"].ToString()); AgreAPI.CustomerID = long.Parse(dictionary["CustomerID"].ToString()); if (State == "Edit") { AgreAPI.ID = Convert.ToInt64(HttpContext.Current.Session["AggreAPIID"].ToString()); long AggiAPIID = aggregator.SaveAggreegatorAPI(AgreAPI, profile.DBConnection._constr); } else { long AggiAPIID = aggregator.SaveAggreegatorAPI(AgreAPI, profile.DBConnection._constr); } result = "API saved successfully"; } catch { result = "Some error occurred"; } finally { aggregator.Close(); } return(result); }