private void showEditData() { ECCMS _objDetail = new ECCMS(); try { tblComplainRow _objRow = new tblComplainRow(); lkpProvinceRow _objProvRow = new lkpProvinceRow(); lkpDistrictRow _objDistRow = new lkpDistrictRow(); lkpPollingCenterRow _objPCRow = new lkpPollingCenterRow(); lkpCandidateRow _objCandRow = new lkpCandidateRow(); _objRow = _objDetail.tblComplainCollection.GetRow("CaseID= " + CaseID + ""); txtCaseNo.Text = _objRow.CaseNo.ToString(); txtSubDate.Text = _objRow.Sub_Date.ToShortDateString(); txtTriDate.Text = _objRow.Tri_Date.ToShortDateString(); txtPS.Text = _objRow.PS.ToString(); drpKuchi.SelectedValue = _objRow.Kuchi.ToString(); txtSummary.Text = _objRow.AllegationSummary.ToString().Trim(); txtDecision.Text = _objRow.Decision.ToString().Trim(); txtECCDecision.Text = _objRow.Ecc_HQ_Decision.ToString().Trim(); _objCandRow = _objDetail.lkpCandidateCollection.GetRow("Cand_ID=" + _objRow.Comp_Cand_ID); //_objProvRow = _objDetail.lkpProvinceCollection.GetRow("ProvID=" + _objCandRow.Prov_ID); _objPCRow = _objDetail.lkpPollingCenterCollection.GetRow("PolCen_ID=" + _objRow.PolCen_ID); _objDistRow = _objDetail.lkpDistrictCollection.GetRow("District_Code=" + _objPCRow.District_Code); drpDistrict.SelectedValue = _objPCRow.District_Code; //_objProvRow = _objDetail.lkpProvinceCollection.GetRow("ProvId=" + _objDistRow.Province_Id + ""); drpProvince.SelectedValue = _objRow.ProvID.ToString(); fillProvRelated(); fillDistrictRelated(); drpCasePro.SelectedValue = _objRow.CaseProID.ToString(); drpPC.SelectedValue = _objRow.PolCen_ID.ToString(); drpGender1.SelectedValue = _objRow.Comp_GenderID.ToString(); drpGender2.SelectedValue = _objRow.Resp_GenderID.ToString(); drpCandidate.SelectedValue = _objRow.Comp_Cand_ID.ToString(); drpComplaintType.SelectedValue = _objRow.Comp_TypeID.ToString(); drpRespondantType.SelectedValue = _objRow.Resp_TypeID.ToString(); drpAllegationType.SelectedValue = _objRow.AllagType_ID.ToString(); drpResponOffice.SelectedValue = _objRow.Resp_OfficeID.ToString(); drpStatus.SelectedValue = _objRow.StatusID.ToString(); drpSanctTypr.SelectedValue = _objRow.SanctionID.ToString(); drpAppeal.SelectedValue = _objRow.Appeal.ToString(); } finally { _objDetail.Dispose(); } }
private void _SaveExcelCase() { ECCMS _dbobj = new ECCMS(); _iAlreadyinserted = 0; _inserted = 0; try { tblComplainRow _objComplain = new tblComplainRow(); for (int i = 0; i <= _gvList.Rows.Count - 1; i++) { GridViewRow _grRow = this._gvList.Rows[i]; _CaseLen = _grRow.Cells[0].Text.Length.ToString(); if (_CaseLen == "4" && _grRow.Cells[2].Text == "2") { _CaseNumber = "A-10-" + string.Format("{0:00}", Convert.ToInt32(_grRow.Cells[20].Text)) + "-" + _grRow.Cells[0].Text; } else if (_CaseLen == "4" && _grRow.Cells[2].Text == "1") { _CaseNumber = "K-10-" + string.Format("{0:00}", Convert.ToInt32(_grRow.Cells[20].Text)) + "-" + _grRow.Cells[0].Text; } else if (_CaseLen == "7" && _grRow.Cells[2].Text == "2") { _CaseNumber = "A-10-" + _grRow.Cells[0].Text; } else if (_CaseLen == "7" && _grRow.Cells[2].Text == "1") { _CaseNumber = "K-10-" + _grRow.Cells[0].Text; } else { _CaseNumber = _grRow.Cells[0].Text; } _objComplain = _dbobj.tblComplainCollection.GetRow("CaseNo=N'" + _CaseNumber + "' and ProvID= " + Convert.ToInt32(_grRow.Cells[20].Text) + " and isDeleted = 0"); if (_objComplain == null) { _inserted++; _objComplain = new tblComplainRow(); _CaseNotInserted = _grRow.Cells[0].Text; _objComplain.CaseNo = _CaseNumber; _objComplain.Sub_Date = Convert.ToDateTime(_grRow.Cells[1].Text); _objComplain.Kuchi = Convert.ToInt32(_grRow.Cells[2].Text); _objComplain.CaseProID = Convert.ToInt32(_grRow.Cells[3].Text); _objComplain.Tri_Date = Convert.ToDateTime(_grRow.Cells[4].Text); _objComplain.ProvID = Convert.ToInt32(_grRow.Cells[20].Text); _objComplain.PolCen_ID = Convert.ToInt32(_grRow.Cells[5].Text); _objComplain.PS = _grRow.Cells[6].Text; _objComplain.Comp_GenderID = Convert.ToInt32(_grRow.Cells[7].Text); _objComplain.Comp_Cand_ID = Convert.ToInt32(_grRow.Cells[8].Text); _objComplain.Comp_TypeID = Convert.ToInt32(_grRow.Cells[9].Text); _objComplain.Resp_GenderID = Convert.ToInt32(_grRow.Cells[10].Text); _objComplain.Resp_TypeID = Convert.ToInt32(_grRow.Cells[11].Text); _objComplain.AllagType_ID = Convert.ToInt32(_grRow.Cells[12].Text); _objComplain.AllegationSummary = _grRow.Cells[13].Text; _objComplain.Resp_OfficeID = Convert.ToInt32(_grRow.Cells[14].Text); _objComplain.StatusID = Convert.ToInt32(_grRow.Cells[15].Text); _objComplain.Decision = _grRow.Cells[16].Text; _objComplain.SanctionID = Convert.ToInt32(_grRow.Cells[17].Text); _objComplain.Appeal = Convert.ToInt32(_grRow.Cells[18].Text); _objComplain.Ecc_HQ_Decision = _grRow.Cells[19].Text; _objComplain.IsDeleted = false; _objComplain.CreatedBy = UserId; _objComplain.CreatedTime = DateTime.Now; _objComplain.UpdatedBy = UserId; _objComplain.UpdatedTime = DateTime.Now; _dbobj.tblComplainCollection.Insert(_objComplain); lbl_Inserted.Text = _inserted.ToString(); } else { _iAlreadyinserted++; //lblMsg.Text = "Already Inserted" + lblMsg.Text + "//" + _objComplain.CaseNo.ToString(); _objComplain = _dbobj.tblComplainCollection.GetRow("CaseNo=N'" + _CaseNumber + "' and ProvID= " + Convert.ToInt32(_grRow.Cells[20].Text) + " and isDeleted = 0"); _objComplain.CaseNo = _CaseNumber; _CaseNotInserted = _grRow.Cells[0].Text; _objComplain.Sub_Date = Convert.ToDateTime(_grRow.Cells[1].Text); _objComplain.Kuchi = Convert.ToInt32(_grRow.Cells[2].Text); _objComplain.CaseProID = Convert.ToInt32(_grRow.Cells[3].Text); _objComplain.Tri_Date = Convert.ToDateTime(_grRow.Cells[4].Text); _objComplain.ProvID = Convert.ToInt32(_grRow.Cells[20].Text); _objComplain.PolCen_ID = Convert.ToInt32(_grRow.Cells[5].Text); _objComplain.PS = _grRow.Cells[6].Text; _objComplain.Comp_GenderID = Convert.ToInt32(_grRow.Cells[7].Text); _objComplain.Comp_Cand_ID = Convert.ToInt32(_grRow.Cells[8].Text); _objComplain.Comp_TypeID = Convert.ToInt32(_grRow.Cells[9].Text); _objComplain.Resp_GenderID = Convert.ToInt32(_grRow.Cells[10].Text); _objComplain.Resp_TypeID = Convert.ToInt32(_grRow.Cells[11].Text); _objComplain.AllagType_ID = Convert.ToInt32(_grRow.Cells[12].Text); _objComplain.AllegationSummary = _grRow.Cells[13].Text; _objComplain.Resp_OfficeID = Convert.ToInt32(_grRow.Cells[14].Text); _objComplain.StatusID = Convert.ToInt32(_grRow.Cells[15].Text); _objComplain.Decision = _grRow.Cells[16].Text; _objComplain.SanctionID = Convert.ToInt32(_grRow.Cells[17].Text); _objComplain.Appeal = Convert.ToInt32(_grRow.Cells[18].Text); _objComplain.Ecc_HQ_Decision = _grRow.Cells[19].Text; _objComplain.IsDeleted = false; _objComplain.UpdatedBy = UserId; _objComplain.UpdatedTime = DateTime.Now; _dbobj.tblComplainCollection.Update(_objComplain); lblPresent.Text = _iAlreadyinserted.ToString(); lblUpdated.Text = lblUpdated.Text + "-(" + _grRow.Cells[0].Text + ")"; } // } } catch (Exception ex) { lblMsg.Text = _CaseNotInserted.ToString(); lblStoped.Text = _CaseNotInserted.ToString(); System.IO.File.Delete(Server.MapPath(".\\uploadfile\\" + Session["UserName"].ToString() + "DataEntry.xls")); } finally { _dbobj.Dispose(); } }
private void saveComplain() { ECCMS _objDb = new ECCMS(); try { tblComplainRow _objComplain = new tblComplainRow(); if (CaseID == "") { _objComplain.CaseNo = GetCaseNo(Convert.ToInt32(drpProvince.SelectedValue)); txtCaseNo.Text = _objComplain.CaseNo.ToString(); _objComplain.Sub_Date = Convert.ToDateTime(txtSubDate.Text.Trim()); _objComplain.Kuchi = Convert.ToInt32(drpKuchi.SelectedValue); _objComplain.CaseProID = Convert.ToInt32(drpCasePro.SelectedValue); _objComplain.Tri_Date = Convert.ToDateTime(txtTriDate.Text.Trim()); _objComplain.ProvID = Convert.ToInt32(drpProvince.SelectedValue); _objComplain.PolCen_ID = Convert.ToInt32(drpPC.SelectedValue); _objComplain.PS = txtPS.Text.Trim(); _objComplain.Comp_GenderID = Convert.ToInt32(drpGender1.SelectedValue); _objComplain.Comp_Cand_ID = Convert.ToInt32(drpCandidate.SelectedValue); _objComplain.Comp_TypeID = Convert.ToInt32(drpComplaintType.SelectedValue); _objComplain.Resp_GenderID = Convert.ToInt32(drpGender2.SelectedValue); _objComplain.Resp_TypeID = Convert.ToInt32(drpRespondantType.SelectedValue); _objComplain.AllagType_ID = Convert.ToInt32(drpAllegationType.SelectedValue); _objComplain.AllegationSummary = txtSummary.Text.Trim(); _objComplain.Resp_OfficeID = Convert.ToInt32(drpResponOffice.SelectedValue); _objComplain.StatusID = Convert.ToInt32(drpStatus.SelectedValue); _objComplain.Decision = txtDecision.Text.Trim(); _objComplain.SanctionID = Convert.ToInt32(drpSanctTypr.SelectedValue); _objComplain.Appeal = Convert.ToInt32(drpAppeal.SelectedValue); _objComplain.Ecc_HQ_Decision = txtECCDecision.Text.Trim(); _objComplain.IsDeleted = false; _objComplain.CreatedBy = UserId; _objComplain.CreatedTime = DateTime.Now; _objComplain.UpdatedBy = UserId; _objComplain.UpdatedTime = DateTime.Now; _objDb.tblComplainCollection.Insert(_objComplain); _Case_ID = _objComplain.CaseID.ToString(); strstatus = "Add"; } else if (CaseID != "") { _objComplain = _objDb.tblComplainCollection.GetRow("CaseID=" + Convert.ToInt32(CaseID) + ""); _objComplain.Sub_Date = Convert.ToDateTime(txtSubDate.Text.Trim()); _objComplain.Kuchi = Convert.ToInt32(drpKuchi.SelectedValue); _objComplain.CaseProID = Convert.ToInt32(drpCasePro.SelectedValue); _objComplain.Tri_Date = Convert.ToDateTime(txtTriDate.Text.Trim()); _objComplain.ProvID = Convert.ToInt32(drpProvince.SelectedValue); _objComplain.PolCen_ID = Convert.ToInt32(drpPC.SelectedValue); _objComplain.PS = txtPS.Text.Trim(); _objComplain.Comp_GenderID = Convert.ToInt32(drpGender1.SelectedValue); _objComplain.Comp_Cand_ID = Convert.ToInt32(drpCandidate.SelectedValue); _objComplain.Comp_TypeID = Convert.ToInt32(drpComplaintType.SelectedValue); _objComplain.Resp_GenderID = Convert.ToInt32(drpGender2.SelectedValue); _objComplain.Resp_TypeID = Convert.ToInt32(drpRespondantType.SelectedValue); _objComplain.AllagType_ID = Convert.ToInt32(drpAllegationType.SelectedValue); _objComplain.AllegationSummary = txtSummary.Text.Trim(); _objComplain.Resp_OfficeID = Convert.ToInt32(drpResponOffice.SelectedValue); _objComplain.StatusID = Convert.ToInt32(drpStatus.SelectedValue); _objComplain.Decision = txtDecision.Text.Trim(); _objComplain.SanctionID = Convert.ToInt32(drpSanctTypr.SelectedValue); _objComplain.Appeal = Convert.ToInt32(drpAppeal.SelectedValue); _objComplain.Ecc_HQ_Decision = txtECCDecision.Text.Trim(); //_objComplain.IsDeleted = false; _objComplain.CreatedBy = UserId; _objComplain.CreatedTime = DateTime.Now; _objComplain.UpdatedBy = UserId; _objComplain.UpdatedTime = DateTime.Now; _objDb.tblComplainCollection.Update(_objComplain); strstatus = "Update"; _Case_ID = CaseID.ToString(); } //Response.Redirect("ComplainDetail.aspx?CaseNo=" + ECCCommon.EncryptQueryString(_objComplain.CaseNo.ToString()) + ""); } finally { _objDb.Dispose(); } }
private void showData() { ECCMS _objDetail = new ECCMS(); try { tblComplainRow _objRow = new tblComplainRow(); lkpProvinceRow _objProvRow = new lkpProvinceRow(); lkpDistrictRow _objDistRow = new lkpDistrictRow(); lkpPollingCenterRow _objPCRow = new lkpPollingCenterRow(); lkpBitRow _objBitRow = new lkpBitRow(); lkpCasepriorityRow _objCasePro = new lkpCasepriorityRow(); lkpGendersRow _objGenderRow = new lkpGendersRow(); lkpCandidateRow _objCandRow = new lkpCandidateRow(); lkpComplainanttypeRow _objComp_Type = new lkpComplainanttypeRow(); lkpRespondanttypeRow _objResp_Type = new lkpRespondanttypeRow(); lkpAllegationtypeRow _objAllega_Type = new lkpAllegationtypeRow(); lkpResponsibleOfficeRow _objResp_Office = new lkpResponsibleOfficeRow(); lkpSanctionRow _objSanc = new lkpSanctionRow(); lkpStatusRow _objStatusRow = new lkpStatusRow(); _objRow = _objDetail.tblComplainCollection.GetRow("CaseID=" + CaseID + ""); txtCaseNo.Text = _objRow.CaseNo.ToString(); txtSubDate.Text = _objRow.Sub_Date.ToShortDateString(); txtTriDate.Text = _objRow.Tri_Date.ToShortDateString(); txtPS.Text = _objRow.PS.ToString(); txtSummary.Text = _objRow.AllegationSummary.ToString().Trim(); txtDecision.Text = _objRow.Decision.ToString().Trim(); txtEccHQDecision.Text = _objRow.Ecc_HQ_Decision.ToString().Trim(); _objBitRow = _objDetail.lkpBitCollection.GetRow("BitID=" + _objRow.Kuchi); txtKuchi.Text = _objBitRow.BitName.ToString().Trim(); _objBitRow = _objDetail.lkpBitCollection.GetRow("BitID=" + _objRow.Appeal); txtAppeal.Text = _objBitRow.BitName.ToString().Trim(); _objCasePro = _objDetail.lkpCasepriorityCollection.GetRow("CaseProID=" + _objRow.CaseProID); txtCasePro.Text = _objCasePro.CaseProName.ToString().Trim(); _objCandRow = _objDetail.lkpCandidateCollection.GetRow("Cand_ID=" + _objRow.Comp_Cand_ID); txtCandidateNo.Text = _objCandRow.Cand_No.ToString().Trim(); // _objProvRow = _objDetail.lkpProvinceCollection.GetRow("ProvID=" + _objCandRow.Prov_ID); _objPCRow = _objDetail.lkpPollingCenterCollection.GetRow("PolCen_ID=" + _objRow.PolCen_ID); txtPC.Text = _objPCRow.PolCen_Code; _objDistRow = _objDetail.lkpDistrictCollection.GetRow("District_Code=" + _objPCRow.District_Code); txtDistrict.Text = _objDistRow.District_Name.ToString().Trim(); // _objProvRow = _objDetail.lkpProvinceCollection.GetRow("Provid=" + _objDistRow.Province_Id + ""); // txtProvince.Text = _objProvRow.ProvNameEng.ToString().Trim(); _objProvRow = _objDetail.lkpProvinceCollection.GetRow("ProvID=" + _objRow.ProvID + ""); txtProvince.Text = _objProvRow.ProvNameEng.ToString(); _objGenderRow = _objDetail.lkpGendersCollection.GetRow("GenderID=" + _objRow.Comp_GenderID); txtGender1.Text = _objGenderRow.GenderName.ToString().Trim(); _objGenderRow = _objDetail.lkpGendersCollection.GetRow("GenderID=" + _objRow.Resp_GenderID); txtGender2.Text = _objGenderRow.GenderName.ToString().Trim(); _objComp_Type = _objDetail.lkpComplainanttypeCollection.GetRow("Comp_typeID=" + _objRow.Comp_TypeID); txtComp_Type.Text = _objComp_Type.Comp_Name.ToString().Trim(); _objResp_Type = _objDetail.lkpRespondanttypeCollection.GetRow("RespType_ID=" + _objRow.Resp_TypeID); txtResp_Type.Text = _objResp_Type.RespType_Name.ToString().Trim(); _objAllega_Type = _objDetail.lkpAllegationtypeCollection.GetRow("AllagType_ID=" + _objRow.AllagType_ID); txtAllage_Type.Text = _objAllega_Type.AllagType_Name.ToString().Trim(); _objResp_Office = _objDetail.lkpResponsibleOfficeCollection.GetRow("Resp_OfficeID=" + _objRow.Resp_OfficeID); txtResp_Office.Text = _objResp_Office.Resp_OfficeName.ToString().Trim(); _objStatusRow = _objDetail.lkpStatusCollection.GetRow("StatusID=" + _objRow.StatusID); txtStatus.Text = _objStatusRow.StatusName.ToString().Trim(); _objSanc = _objDetail.lkpSanctionCollection.GetRow("SacntionID=" + _objRow.SanctionID); txtSanction.Text = _objSanc.SacntionName.ToString().Trim(); } finally { _objDetail.Dispose(); } }