protected void btnUpload_Click1(object sender, EventArgs e) { var errMsg = ""; _objCommon = new Common(); try { _objCollegeAssociationCategoryProperty = new CollegeAssociationCategoryProperty(); DataSet _ds = new DataSet(); var _objClsOledbdatalayer = new ClsOleDBDataWrapper(); var excelSheets = new String[0]; string path = MapPath(fileUploadExcel.FileName); fileUploadExcel.SaveAs(path); excelSheets = _objClsOledbdatalayer.CountTotalSheets(path); if (excelSheets.Length > 0) { foreach (string t in excelSheets) { _ds = _objClsOledbdatalayer.getdata(path, t); if (_ds.Tables[0].Rows.Count > 0) { for (int j = 0; j <= _ds.Tables[0].Rows.Count - 1; j++) { _objCollegeAssociationCategoryProperty = new CollegeAssociationCategoryProperty { AssociationCategoryType = _ds.Tables[0].Rows[j]["AssociationCategoryType"].ToString(), AssociationCategoryStatus = Convert.ToBoolean(_ds.Tables[0].Rows[j]["AssociationCategoryStatus"].ToString()) }; int result = CollegeProvider.Instance.UpdateCollegeAssociationCategoryType(_objCollegeAssociationCategoryProperty, LoggedInUserId, out errMsg); if (result > 0) { lblRecordsInserted.Text = ""; lblRecordsInserted.Text = j + " row inserted out of " + _ds.Tables[0].Rows.Count; } } lblSeccessMsg.Text = _objCommon.GetErrorMessage("lblSucessMsg"); Response.Redirect("CollegeGroupMaster.aspx"); } } } else { lblSeccessMsg.Text = _objCommon.GetErrorMessage("lblErrMsg"); } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.ToString(); } const string addInfo = "Error while executing btnUpload_Click1 in AdminPanel/College/CollegeAssociationGroupMaster.aspx :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } }
protected void btnCollegeAssociat_Click(object sender, EventArgs e) { var errorMsg = ""; var insert = 0; try { var objCollegeproperty = new CollegeAssociationCategoryProperty { AssociationCategoryType = Convert.ToString( txtAssociationCategoryName .Text.Trim()), AssociationCategoryStatus = chkAssociationStatus.Checked, AssociationCategoryAmount = txtAmount.Text, AssociationCategoryDescription = fckProductDesc.FckValue, AssociationType = Convert.ToString(ddlProductType.SelectedValue) }; if (ViewState["Id"] == null) { insert = CollegeProvider.Instance.InsertCollegeAssociationCategoryType(objCollegeproperty, LoggedInUserId, out errorMsg); } else { objCollegeproperty.AssociationCategoryTypeId = Convert.ToInt32(ViewState["Id"]); insert = CollegeProvider.Instance.UpdateCollegeAssociationCategoryType(objCollegeproperty, LoggedInUserId, out errorMsg); } BindAllCollegeAssociate(); BindDisplayAds(); ClearControl(); lblSeccessMsg.Text = errorMsg; lblSeccessMsg.CssClass = insert > 0 ? "success show" : "info show"; } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.ToString(); } const string addInfo = "Error while executing btnCollegeAssociat_Click in AdminPanel/College/CollegeAssociationGroupMaster.aspx :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } }
public abstract int UpdateCollegeAssociationCategoryType(CollegeAssociationCategoryProperty objCollegeAssociationCategoryProperty, int modifiedBy, out string errmsg);
public abstract int InsertCollegeAssociationCategoryType(CollegeAssociationCategoryProperty objCollegeAssociationCategoryProperty, int createdBy, out string errmsg);