private void BindNoteType() { try { lvNote_Received.DataSource = credit.GetCreditDebitNoteReceived(Common.LoggedInUserID()); lvNote_Received.DataBind(); lv_Issued.DataSource = credit.GetCreditDebitNoteIssued(Common.LoggedInUserID()); lv_Issued.DataBind(); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void Login_Click(object sender, EventArgs e) { try { if (FailureText.Visible == true) { var result = SignInManager.PasswordSignIn(UserName.Text.Trim(), Password.Text.Trim(), RememberMe.Checked, shouldLockout: false); var hashPassword = Crypto.HashPassword(Password.Text.Trim()); switch (result) { case SignInStatus.Success: var user = UserManager.FindByName(UserName.Text.Trim()); var roles = UserManager.GetRoles(user.Id); FailureText.Text = "sucess."; if (roles.Count > 0) { FailureText.Text = "sucess11."; if (roles.FirstOrDefault().Contains(EnumConstants.RoleName.Admin.ToString())) { System.Web.HttpContext.Current.Response.Redirect("~/Admin/Dashboard"); } else if (roles.FirstOrDefault().Contains(EnumConstants.RoleName.TaxConsultant.ToString()) || roles.FirstOrDefault().Contains(EnumConstants.RoleName.User.ToString())) { System.Web.HttpContext.Current.Response.Redirect("~/User/Dashboard"); } } else { FailureText.Text = "Invalid login attempt."; } return; case SignInStatus.Failure: FailureText.Text = "Invalid login attempt."; return; default: FailureText.Text = "Invalid login attempt."; return; } } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lkbDelete_Click(object sender, EventArgs e) { try { int count = 0; int ValueId; foreach (var item in lv_crdrUnregister.Items) { CheckBox chk = (CheckBox)item.FindControl("chk"); if (chk.Checked) { ValueId = Convert.ToInt32(lv_crdrUnregister.DataKeys[item.DisplayIndex].Values["ValueId"].ToString()); var OfflineObj = unitOfwork.OfflineinvoiceRepository.Filter(x => x.ValueId == ValueId).SingleOrDefault(); if (OfflineObj != null) { List <GST_TRN_OFFLINE_INVOICE_DATAITEM> offlinedataobj = unitOfwork.OfflineinvoicedataitemRepository.Filter(x => x.ValueID == ValueId).ToList(); foreach (var data in offlinedataobj) { unitOfwork.OfflineinvoicedataitemRepository.Delete(data); unitOfwork.Save(); } unitOfwork.OfflineinvoiceRepository.Delete(OfflineObj); unitOfwork.Save(); count++; if (count > 0) { ScriptManager.RegisterStartupScript(this, GetType(), "Showalert", "alert('Are you sure! you want to delete data');", true); uc_sucess.SuccessMessage = "Data Deleted Successfully."; uc_sucess.Visible = !String.IsNullOrEmpty(uc_sucess.SuccessMessage); } } } } BindItems(ReturnType); if (count == 0) { this.WarningMessage = "Please select atleast one row to delete data."; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "viewInvoiceModelWarningMessage", "$('#viewInvoiceModelWarningMessage').modal();", true); //uc_sucess.ErrorMessage = "Please select atleast one row to delete data."; //uc_sucess.Visible = !String.IsNullOrEmpty(uc_sucess.ErrorMessage); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void PopulateInvoices(string specialCondition, byte SelectedMonth) { try { var item = invoiceItems.GetConsolidatetdInvoices(Common.LoggedInUserID(), specialCondition); item = item.FindAll(x => x.GST_TRN_INVOICE.InvoiceMonth == SelectedMonth); lvRegularInvoice.DataSource = item.OrderByDescending(o => o.GST_TRN_INVOICE.InvoiceDate).ToList(); lvRegularInvoice.DataBind(); lvRegularInvoice.Visible = true; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lkbEditInvoice_Click(object sender, EventArgs e) { try { LinkButton lkbItem = (LinkButton)sender; if (!string.IsNullOrEmpty(lkbItem.CommandArgument)) { uc_InvoiceEdit.BindInvoice(Convert.ToInt32(lkbItem.CommandArgument.ToString())); uc_InvoiceEdit.Focus(); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lkbDownloadJSON_Click(object sender, EventArgs e) { // MainContent.Visible = false; // SecondaryContent.Visible = true; // Response.Redirect("~/Offline/B2Boffline"); try { Int16 getMonth = Convert.ToInt16(uc_invoiceMonth.GetValue); generateJson(getMonth); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void BindItems() { try { var loggedinUser = Common.LoggedInUserID(); var SelectedMonth = Convert.ToByte(uc_invoiceMonth.GetValue); var invoices = unitOfWork.OfflineAudittrailRepository.Filter(f => f.Month == SelectedMonth && f.CreatedBy == loggedinUser && f.Status == 1).OrderByDescending(o => o.InvoiceDate).ToList(); lv_AuditTrail.DataSource = invoices.ToList(); lv_AuditTrail.DataBind(); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
private void Credit_Gstr1_lkbBackEvent(object sender, EventArgs e) { try { Credit_Gstr1.Visible = false; //amit uc_crdr_registered.BindItems(Convert.ToByte(rdbGSTR.SelectedValue)); uc_crdr_unregister.BindItems(Convert.ToByte(rdbGSTR.SelectedValue)); MainContent.Visible = true; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
private void AdvanceGSTR1_lkbBackEvent(object sender, EventArgs e) { try { AdvanceGSTR1.Visible = false; //amit uc_Adjust_Advance.BindItems(Convert.ToByte(rdbGSTR.SelectedValue)); uc_Tax_Liability.BindItems(Convert.ToByte(rdbGSTR.SelectedValue)); MainContent.Visible = true; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void BindMonth() { try { ddlmonth.DataSource = typeof(EnumConstants.FinYear).ToList(); ddlmonth.DataTextField = "Value"; ddlmonth.DataValueField = "Key"; ddlmonth.DataBind(); ddlmonth.Items.Insert(0, new ListItem(" [ Select ] ", "0")); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void getInvoices() { try { var loggedinUserId = Common.LoggedInUserID(); if (loggedinUserId != null) { var invoices = unitOfWork.InvoiceRepository.Filter(f => f.CreatedBy == loggedinUserId && f.Status == true).Count(); lblInvoices.Text = invoices.ToString(); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
private void B2CL_GSTR1_lkbBackEvent(object sender, EventArgs e) { try { B2CLGSTR1.Visible = false; //amit uc_B2CL.BindItems(Convert.ToByte(rdbGSTR.SelectedValue)); uc_B2B_Invoices.BindItems(Convert.ToByte(rdbGSTR.SelectedValue)); MainContent.Visible = true; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void btnAddMore_Click(object sender, EventArgs e) { try { Session["ValueId"] = ((LinkButton)sender).CommandArgument; ListViewItem item = (ListViewItem)lv_crdrUnregister.Items[Convert.ToInt32(Session["displayIndex"])]; TextBox txt_invoiceno = (TextBox)item.FindControl("txt_invoiceno"); InvoiceNumber = txt_invoiceno.Text; AddMoreClick(sender, e); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
//public void BindMonth() //{ // Array Months = Enum.GetValues(typeof(EnumConstants.FinYear)); // foreach (EnumConstants.FinYear Month in Months) // { // ddlMonth.Items.Add(new ListItem(Month.ToString(), ((int)Month).ToString())); // } //} public void BindFinyear() { try { ddlfinYear.DataSource = unitOfwork.FinYearRepository.All().OrderBy(o => o.Finyear).ToList(); ddlfinYear.DataTextField = "Finyear_Format"; ddlfinYear.DataValueField = "Fin_ID"; ddlfinYear.DataBind(); ddlfinYear.Items.Insert(0, new ListItem(" [ SELECT ] ", "0")); string Year = DateTime.Now.Year.ToString() + "-" + (DateTime.Now.Year + 1).ToString().Substring((DateTime.Now.Year + 1).ToString().Length - 2); ddlfinYear.Items.FindByText(Year).Selected = true; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void BindInvoice(int invoiceID) { try { var items = unitOfWork.InvoiceRepository.Filter(f => f.InvoiceID == invoiceID).FirstOrDefault(); Invoice = items; gvInvoice_Items.DataSource = items.GST_TRN_INVOICE_DATA.ToList(); gvInvoice_Items.DataBind(); lkbUpdateInvoice.Visible = true; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lkbSave_Click(object sender, EventArgs e) { try { GST_TRN_OFFLINE_INVOICE_DATAITEM dataitem; foreach (var items in lvEXPORTGstr1.Items) { TextBox TotalTaxable_Value = (TextBox)items.FindControl("txt_TaxableValue"); TextBox IGST = (TextBox)items.FindControl("txtIGST"); //Label Rate = (Label)items.FindControl("lblRate"); HiddenField OfflineDataId = (HiddenField)items.FindControl("hdnOfflineDataId"); int RateId = Convert.ToInt32(lvEXPORTGstr1.DataKeys[items.DisplayIndex].Value); int ExistingDataId = Convert.ToInt32(OfflineDataId.Value); if (ExistingDataId <= 0) { dataitem = new GST_TRN_OFFLINE_INVOICE_DATAITEM(); if (Convert.ToDecimal(TotalTaxable_Value.Text) > 0) { dataitem.IGSTAmt = Convert.ToDecimal(IGST.Text); dataitem.TotalTaxableValue = Convert.ToDecimal(TotalTaxable_Value.Text); dataitem.ValueID = Convert.ToInt32(Session["ValueId"]); dataitem.RateId = RateId; unitOfwork.OfflineinvoicedataitemRepository.Create(dataitem); unitOfwork.Save(); } } else { var dataitemexist = unitOfwork.OfflineinvoicedataitemRepository.Filter(x => x.OfflineDataID == ExistingDataId).SingleOrDefault(); if (Convert.ToDecimal(TotalTaxable_Value.Text) > 0) { dataitemexist.IGSTAmt = Convert.ToDecimal(IGST.Text); dataitemexist.TotalTaxableValue = Convert.ToDecimal(TotalTaxable_Value.Text); unitOfwork.OfflineinvoicedataitemRepository.Update(dataitemexist); unitOfwork.Save(); } } } uc_sucess.Visible = true; uc_sucess.SuccessMessage = "Data Saved Successfully"; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lkcImportConsolidated_Click(object sender, EventArgs e) { try { clsMessageAttribute clsMessage = new clsMessageAttribute(); clsMessage = clsInvoice.ImportAllInvoices(Common.LoggedInUserID()); SendHTMLMail(clsMessage, clsMessage.MailString, String.Join(";", ""));//clsMessage.MailsTo.ToArray() BindViewInvoice(Convert.ToByte(uc_invoiceMonth.GetValue)); this.Master.SuccessMessage = clsMessage.CustomMessage; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "viewInvoiceModelSucessMessage", "$('#viewInvoiceModelSucessMessage').modal();", true); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void BindGST() { try { ddlGST.Items.Clear(); Array FileTypes = Enum.GetValues(typeof(EnumConstants.OfflineFileType)); foreach (EnumConstants.OfflineFileType FileType in FileTypes) { ddlGST.Items.Add(new ListItem(FileType.ToString(), ((int)FileType).ToString())); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void btnAddMore_Click(object sender, EventArgs e) { try { //amit 6-12-17 for rate Session["ValueId"] = ((LinkButton)sender).CommandArgument; //ListViewItem item = (ListViewItem)lv_Tax_Liability.Items[Convert.ToInt32(Session["displayIndex"])]; //TextBox txtInvoice = (TextBox)item.FindControl("txtInvoiceNo"); ////InvoiceNumber = txtInvoice.Text; AddMoreClick(sender, e); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lv_HSN_ItemDataBound(object sender, ListViewItemEventArgs e) { try { DropDownList ddl_UQC = (DropDownList)e.Item.FindControl("ddl_UQC"); HiddenField hdnUQC = (HiddenField)e.Item.FindControl("hdnUQC"); if (hdnUQC.Value != null && hdnUQC.Value != "") { ddl_UQC.Items.FindByValue(hdnUQC.Value).Selected = true; } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lstInvoiceR_ItemDataBound(object sender, ListViewItemEventArgs e) { try { if (e.Item.ItemType == ListViewItemType.DataItem) { //ListView lvItems = (ListView)sender.FindControl("lstInvoiceR"); Label lbl = e.Item.FindControl("lblIGSTAmt") as Label; // _quantityTotal +=Convert.ToDecimal(lbl.Text); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
private void BindSaleItems() { try { var loggedinUserId = Common.LoggedInUserID(); if (loggedinUserId != null) { lvSaleItems.DataSource = register.GetSaleItemsInvoices(loggedinUserId).OrderByDescending(o => o.InvoiceDate).ToList(); lvSaleItems.DataBind(); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void BindExcelSection() { try { var userid = Common.LoggedInUserID(); ddlSection.DataSource = unitOfWork.OfflinesectionRepository.Filter(f => f.ActiveStatus == true && f.Type == 1).OrderByDescending(o => o.CreatedDate).Select(s => new { Section_ID = s.Section_ID, Descriptions = s.Description }).ToList(); ddlSection.DataValueField = "Section_ID"; ddlSection.DataTextField = "Descriptions"; ddlSection.DataBind(); ddlSection.Items.Insert(0, new ListItem(" [ SELECT ] ", "0")); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void BindItems(string Section) { try { List <GST_TRN_OFFLINE_INVOICE_RATE> objList = new List <GST_TRN_OFFLINE_INVOICE_RATE>(); var data = unitOfwork.OfflinerateRepository.All().ToList(); objList.AddRange(data); litSection.Text = Section; lv_Adv_Adjustment_GSTR1.DataSource = objList; lv_Adv_Adjustment_GSTR1.DataBind(); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lv_crdrRegister_ItemEditing(object sender, ListViewEditEventArgs e) { try { //ListViewItem item = lv_crdrRegister.Items[e.NewEditIndex]; //uc_SupplyType uc_SupplyType = (uc_SupplyType)item.FindControl("uc_SupplyType"); lv_crdrRegister.EditIndex = e.NewEditIndex; //uc_SupplyType.BindItems(); Session["displayIndex"] = e.NewEditIndex; BindItems(ReturnType); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void btnPurchaseData_Click(object sender, EventArgs e) { GST_MST_PURCHASE_DATA PD = new GST_MST_PURCHASE_DATA(); try { foreach (GST_MST_PURCHASE_DATA item in GetGVData()) { if (item.PurchaseDataID != 0) { unitOfwork.PurchaseDataRepositry.Update(item); } else { unitOfwork.PurchaseDataRepositry.Create(item); } // count = count + 1; //if (count > 0) //{ // this.Master.SuccessMessage = "Data submitted successfully !"; // //uc_sucess.Visible = true; // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "viewInvoiceModelSucessMessage", "$('#viewInvoiceModelSucessMessage').modal();", true); //} //else //{ // this.Master.WarningMessage = "Enter valid data !."; // //uc_sucess.Visible = true; // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "viewInvoiceModelWarningMessage", "$('#viewInvoiceModelWarningMessage').modal();", true); //} uc_sucess.SuccessMessage = "Data Submited Successfully."; uc_sucess.Visible = true; } unitOfwork.Save(); BindItems(); ddlInvoiceNum.SelectedIndex = 0; } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
private void BindFile_GSTR6_11_B() { try { var loggedinUserId = Common.LoggedInUserID(); if (loggedinUserId != null) { string SellerUserID = Common.LoggedInUserID(); var invoice = unitOfWork.GetGSTR_6_11_B(SellerUserID); lv_GSTR6_11_B.DataSource = invoice.ToList(); lv_GSTR6_11_B.DataBind(); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
public void TotalItems() { try { var loggedinUserId = Common.LoggedInUserID(); if (loggedinUserId != null) { //var items = unitOfWork.PurchaseDataRepositry.Filter(f => f.GST_MST_PURCHASE_REGISTER.UserID == loggedinUserId && f.GST_MST_PURCHASE_REGISTER.Status == true).Select(c => c.Qty).Count(); var items = unitOfWork.ItemRepository.Filter(f => f.UserId == loggedinUserId).Select(c => c.ItemCode).Count(); lblItems.Text = items.ToString(); } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
private void BindInvoices() { try { if (!string.IsNullOrEmpty(ViewInvoiceID)) { var item = invoiceItems.GetConsolidatetdInvoices(Common.LoggedInUserID(), ViewInvoiceID); lvRegularInvoice.DataSource = item.ToList(); lvRegularInvoice.DataBind(); lvRegularInvoice.Visible = true; } } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }
protected void lkbDownload3B_Click(object sender, EventArgs e) { try { LinkButton lkbdownload = (LinkButton)sender; String UserID = Convert.ToString(lkbdownload.CommandArgument.ToString()); var userId = Common.LoggedInUserID(); //var Month = Convert.ToByte(uc_invoiceMonth.GetValue); var SelectedMonth = Int32.Parse(uc_invoiceMonth.GetValue); /// var invoice = unitOfWork.OfflineAudittrailRepository.Filter(f => f.UserID == userId).FirstOrDefault(); ReportGenerate.ExcelDownloadGstr_3B(userId, SelectedMonth); } catch (Exception ex) { cls_ErrorLog ob = new cls_ErrorLog(); cls_ErrorLog.LogError(ex, Common.LoggedInUserID()); } }