public string UpdateUser(DTO.UserMaster Ob) { string res = ""; if (Ob.PreUserPin != Ob.UserPin) { if (CheckDuplicateUserPin(Ob) == true) { res = "User pin is already in Use, Please enter new Pin."; return(res); } } if (Ob.PreUserBarcode != Ob.UserBarcode) { if (CheckDuplicateUserBarcode(Ob) == true) { res = "User Barcode is already in use, Please change the barcode."; return(res); } } SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_UserMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserId", Ob.UserId); cmd.Parameters.AddWithValue("@UserPassword", Ob.UserPassword); cmd.Parameters.AddWithValue("@UserTypeCode", Ob.UserTypeCode); cmd.Parameters.AddWithValue("@UserBranchCode", Ob.UserBranchCode); cmd.Parameters.AddWithValue("@UserName", Ob.UserName); cmd.Parameters.AddWithValue("@UserAddress", Ob.UserAddress); cmd.Parameters.AddWithValue("@UserPhoneNumber", Ob.UserPhoneNumber); cmd.Parameters.AddWithValue("@UserMobileNumber", Ob.UserMobileNumber); cmd.Parameters.AddWithValue("@UserEmailId", Ob.UserEmailId); cmd.Parameters.AddWithValue("@UserActive", Ob.UserActive); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@Updatepassword", Ob.Updatepassword); cmd.Parameters.AddWithValue("@Userbarcode", Ob.UserBarcode); cmd.Parameters.AddWithValue("@UserPin", Ob.UserPin); cmd.Parameters.AddWithValue("@Flag", 2); res = PrjClass.ExecuteNonQuery(cmd); return(res); }
public string UpdatePassword(string BID, string UserName, string Password, string NewPassword) { string res = string.Empty; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Proc_Registration"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@UserName", UserName); cmd.Parameters.AddWithValue("@UserPassword", Password); cmd.Parameters.AddWithValue("@UserNewPassword", NewPassword); cmd.Parameters.AddWithValue("@Flag", 5); res = PrjClass.ExecuteNonQuery(cmd); return(res); }
public bool CheckBookingNumberInFactory(string BookingNumber, string ExternalBID) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_Dry_DrawlMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BookingNumber", BookingNumber); cmd.Parameters.AddWithValue("@BranchId", ExternalBID); cmd.Parameters.AddWithValue("@Flag", 36); var sdr = PrjClass.ExecuteScalar(cmd); if (Int32.Parse(sdr) > 0) { return(true); } else { return(false); } }
public string SaveReason(DTO.Common Ob) { string res = ""; if (CheckDuplicateReason(Ob) == false) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_RemoveReason"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@RemoveReason", Ob.Input); cmd.Parameters.AddWithValue("@BranchId", Ob.BID); cmd.Parameters.AddWithValue("@Flag", 1); res = PrjClass.ExecuteNonQuery(cmd); } else { res = "Record allready exists."; } return(res); }
private bool DeleteItemRate(DTO.Common Ob) { SqlCommand cmd = new SqlCommand(); string res = ""; cmd.CommandText = "sp_ItemWisePriceList"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", Ob.BID); cmd.Parameters.AddWithValue("@ItemName", Ob.Input); cmd.Parameters.AddWithValue("@Flag", 4); res = PrjClass.ExecuteNonQuery(cmd); if (res == "Record Saved") { return(true); } else { return(false); } }
public string DeleteBranch(DTO.BranchMaster Ob) { string res = ""; if (CheckRecord(Ob) == false) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_BranchMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@Flag", 6); res = PrjClass.ExecuteNonQuery(cmd); } else { res = "Branch use in bookings."; return(res); } return(res); }
private void GetProcessDetails(string strProcessCode) { string Drawlname = ""; SqlConnection sqlcon = new SqlConnection(PrjClass.sqlConStr); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT * FROM mstDrwal WHERE Id = '" + strProcessCode + "'"; SqlDataReader sdr = null; try { sqlcon.Open(); cmd.Connection = sqlcon; sdr = cmd.ExecuteReader(); if (sdr.Read()) { hdnSelectedProcessCode.Value = "" + sdr.GetValue(0); Drawlname = "" + sdr.GetValue(1); PrjClass.SetItemInDropDown(drpDrawl, Drawlname, true, false); txtParent.Text = "" + sdr.GetValue(2); } sdr.Close(); sdr = null; btnEdit.Enabled = true; EnableModification(false); btnDelete.Enabled = true; } catch (Exception excp) { lblErr.Text = "Error (GetProcessDetails()): " + excp.Message; } finally { if (sdr != null) { sdr.Close(); sdr.Dispose(); } sqlcon.Close(); sqlcon.Dispose(); } }
public bool checkAcsRights(string pageTitle, string userId, string BID) { SqlCommand cmd = new SqlCommand(); string res = string.Empty; cmd.CommandText = "sp_Dry_BarcodeMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageTitle", pageTitle); cmd.Parameters.AddWithValue("@UserTypeId", userId); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 34); res = PrjClass.ExecuteScalar(cmd); if (res == "True") { return(true); } else { return(false); } }
public string SaveItem(DTO.Item Ob) { if (CheckIfItemCodeExits(Ob.ItemCode, Ob.BranchId) == false) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_Item"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ItemName", Ob.ItemName); cmd.Parameters.AddWithValue("@NoOfItem", Ob.NoOfItem); cmd.Parameters.AddWithValue("@ItemCode", Ob.ItemCode); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@Unit", Ob.VariationId); cmd.Parameters.AddWithValue("@Flag", "1"); Common.Result = PrjClass.ExecuteNonQuery(cmd); } else { Common.Result = "Item code already exists Please Provide a Unique Item Code"; } return(Common.Result); }
private string CheckEmployee(DTO.Employee Ob) { Common.Result = ""; SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; cmd.CommandText = "sp_Dry_EmployeeMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@EmployeeCode", Ob.EmpCode); cmd.Parameters.AddWithValue("@BranchId", Ob.BID); cmd.Parameters.AddWithValue("@Flag", 13); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { Common.Result = "true"; } sdr.Dispose(); sdr.Close(); cmd.Dispose(); return(Common.Result); }
public string SaveBranch(DTO.BranchMaster Ob) { string res = ""; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_BranchMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchCode", Ob.BranchCode); cmd.Parameters.AddWithValue("@BranchName", Ob.BranchName); cmd.Parameters.AddWithValue("@BranchAddress", Ob.BranchAddress); cmd.Parameters.AddWithValue("@BranchPhone", Ob.BranchPhone); cmd.Parameters.AddWithValue("@BranchSlogan", Ob.BranchSlogan); cmd.Parameters.AddWithValue("@IsFactory", Ob.IsBF); cmd.Parameters.AddWithValue("@IsChallan", Ob.IsChallan); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@BranchMobile", Ob.BranchMobile); cmd.Parameters.AddWithValue("@BranchEmail", Ob.BranchEmail); cmd.Parameters.AddWithValue("@Flag", 1); res = PrjClass.ExecuteNonQuery(cmd); return(res); }
private string SaveInTheEntMenuRightsTable(System.Data.DataTable dto) { string res = ""; for (int iRow = 0; iRow < dto.Rows.Count; iRow++) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_NewBooking"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserTypeId", dto.Rows[iRow]["UserTypeId"].ToString()); cmd.Parameters.AddWithValue("@PageTitle", dto.Rows[iRow]["PageTitle"].ToString()); cmd.Parameters.AddWithValue("@FileName", dto.Rows[iRow]["FileName"].ToString()); cmd.Parameters.AddWithValue("@RightToView", dto.Rows[iRow]["RightToView"].ToString()); cmd.Parameters.AddWithValue("@MenuItemLevel", dto.Rows[iRow]["MenuItemLevel"].ToString()); cmd.Parameters.AddWithValue("@MenuPosition", dto.Rows[iRow]["MenuPosition"].ToString()); cmd.Parameters.AddWithValue("@ParentMenu", dto.Rows[iRow]["ParentMenu"].ToString()); cmd.Parameters.AddWithValue("@Flag", 22); res = PrjClass.ExecuteNonQuery(cmd); } return(res); }
public bool SetSMSCheckBoxOnScreen(string BID, string Flag) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; string status = string.Empty; bool returnvalue = false; try { cmd.CommandText = "SP_smsconfig"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", Flag); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = sdr.GetValue(0).ToString(); } else { status = "FALSE"; } if (status == "TRUE") { returnvalue = true; } else { returnvalue = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(returnvalue); }
private string SaveBookingDetails(DTO.Common Ob) { string res = string.Empty; DataTable DTBookingDetails = GetData(Ob); for (int iRow = 0; iRow < DTBookingDetails.Rows.Count; iRow++) { SqlCommand CMD_BookingDetails = new SqlCommand(); CMD_BookingDetails.CommandText = "sp_NewXmlSave"; CMD_BookingDetails.CommandType = CommandType.StoredProcedure; CMD_BookingDetails.Parameters.AddWithValue("@ISN", DTBookingDetails.Rows[iRow]["ISN"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemName", DTBookingDetails.Rows[iRow]["ItemName"].ToString()); if (DTBookingDetails.Rows[iRow]["ItemTotalQuantity"].ToString() == "0") { DTBookingDetails.Rows[iRow]["ItemTotalQuantity"] = 1; } else { CMD_BookingDetails.Parameters.AddWithValue("@ItemTotalQuantity", DTBookingDetails.Rows[iRow]["ItemTotalQuantity"].ToString()); } CMD_BookingDetails.Parameters.AddWithValue("@ItemProcessType", DTBookingDetails.Rows[iRow]["ItemProcessType"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemQuantityAndRate", DTBookingDetails.Rows[iRow]["ItemQuantityAndRate"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemExtraProcessType1", DTBookingDetails.Rows[iRow]["ItemExtraProcessType1"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemExtraProcessRate1", DTBookingDetails.Rows[iRow]["ItemExtraProcessRate1"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemExtraProcessType2", DTBookingDetails.Rows[iRow]["ItemExtraProcessType2"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemExtraProcessRate2", DTBookingDetails.Rows[iRow]["ItemExtraProcessRate2"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemSubTotal", DTBookingDetails.Rows[iRow]["ItemSubTotal"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemRemark", DTBookingDetails.Rows[iRow]["ItemRemark"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@ItemColor", DTBookingDetails.Rows[iRow]["ItemColor"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@STPAmt", DTBookingDetails.Rows[iRow]["STPAmt"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@STEP1Amt", DTBookingDetails.Rows[iRow]["STEP1Amt"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@STEP2Amt", DTBookingDetails.Rows[iRow]["STEP2Amt"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@BOOKINGNUMBER", DTBookingDetails.Rows[iRow]["BookingNumber"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@BranchId", DTBookingDetails.Rows[iRow]["BranchId"].ToString()); CMD_BookingDetails.Parameters.AddWithValue("@Flag", 2); res = PrjClass.ExecuteNonQuery(CMD_BookingDetails); } return(res); }
protected void grdReport_RowDataBound(object sender, GridViewRowEventArgs e) { // Mohit Chauhan // set the headers dynamically if (strPrinterName == "") { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); } if (drpReportFrom.SelectedItem.Text == "Booking" || drpReportFrom.SelectedItem.Text == "Delivery") { if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hypBookingNo = (HyperLink)e.Row.FindControl("hypBtnShowDetails"); string strBookinNo = hypBookingNo.Text; Label lblDueDate = (Label)e.Row.FindControl("lblDate"); string strDuedate = lblDueDate.Text; hypBookingNo.NavigateUrl = String.Format("~/" + strPrinterName + "/BookingSlip.aspx?BN={0}{1}{2}", strBookinNo, "-1", strDuedate); } } if (e.Row.RowType == DataControlRowType.Header) { if (drpReportFrom.SelectedItem.Text == "Booking" || drpReportFrom.SelectedItem.Text == "Delivery") { // the tax col are 5 (main tax), 6 (second tax), 7 (third tax) e.Row.Cells[10].Text = _LabelTax1; e.Row.Cells[11].Text = _LabelTax2; e.Row.Cells[12].Text = _LabelTax3; } else { e.Row.Cells[9].Text = _LabelTax1; e.Row.Cells[10].Text = _LabelTax2; e.Row.Cells[11].Text = _LabelTax3; } } else if (e.Row.RowType == DataControlRowType.Footer) { e.Row.BackColor = System.Drawing.Color.GreenYellow; } }
/// <summary> /// Assign Package Function /// </summary> /// <param name="Ob"></param> /// <returns></returns> public string SaveAssignPackage(DTO.PackageMaster Ob, bool isQtyItemBased = false) { string res = ""; int AssignId = PrjClass.getNewIDAccordingBID("AssignPackage", "AssignId", Ob.BranchId); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_PackageMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@AssignId", AssignId); cmd.Parameters.AddWithValue("@PackageId", Ob.PackageId); cmd.Parameters.AddWithValue("@StartValue", Ob.StartValue); cmd.Parameters.AddWithValue("@CustomerCode", Ob.CustomerCode); cmd.Parameters.AddWithValue("@StartDate", Ob.StartDate); cmd.Parameters.AddWithValue("@EndDate", Ob.EndDate); cmd.Parameters.AddWithValue("@Active", Ob.Active); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@PaymentTypes", Ob.PaymentTypes); cmd.Parameters.AddWithValue("@PaymentDetail", Ob.PaymentDetails); cmd.Parameters.AddWithValue("@MembershipId", Ob.MembershipId); cmd.Parameters.AddWithValue("@BarCode", Ob.BarCode); cmd.Parameters.AddWithValue("@DefaultDiscountRate", Ob.CurDiscount); cmd.Parameters.AddWithValue("@Recurrence", Ob.Recurrence); cmd.Parameters.AddWithValue("@PackageTotalCost", Ob.PackageTotalCost); cmd.Parameters.AddWithValue("@CustEmail", Ob.CustomerEmailID); cmd.Parameters.AddWithValue("@Custmobile", Ob.CustomerMobile); cmd.Parameters.AddWithValue("@Flag", 9); res = PrjClass.ExecuteNonQuery(cmd); if (isQtyItemBased && res == "Record Saved") { var dt = DateTime.Parse(Ob.StartDate); var dt2 = DateTime.Parse(Ob.EndDate); var dd = dt2 - dt; var _res = SaveInRecurrence(AssignId, dt, (int)dd.TotalDays + 1, int.Parse(Ob.Recurrence), Ob.BranchId); if (_res != "Record Saved") { return(_res); } } return(res); }
public string GetQtyndItemsForPackage(string custCode, int assignId, int recurrenceId, string BID) { SqlCommand cmd = new SqlCommand(); SqlDataReader rdr = null; var strItem = new StringBuilder(); var strQty = new StringBuilder(); try { cmd.CommandText = "sp_shiftMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@custCode", custCode); cmd.Parameters.AddWithValue("@assignIdp", assignId); cmd.Parameters.AddWithValue("@RID", recurrenceId); cmd.Parameters.AddWithValue("@Flag", 12); rdr = PrjClass.ExecuteReader(cmd); while (rdr.Read()) { strItem.Append(rdr["ItemName"].ToString().ToUpperInvariant() + ":"); strQty.Append(rdr["Qty"].ToString() + ":"); } if (strItem.Length > 2) { strItem.Remove(strItem.Length - 1, 1); } if (strQty.Length > 2) { strQty.Remove(strQty.Length - 1, 1); } } catch (Exception ex) { } finally { rdr.Close(); rdr.Dispose(); cmd.Dispose(); } return(strItem.ToString() + "_" + strQty.ToString()); }
public void DeafultBind() { txtBarcode.Focus(); Page.DataBind(); BindGrid(); BindDrop(); binddrpsms(); binddrpdefaultsms(); SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; try { cmd.CommandText = "SELECT RightToView FROM dbo.EntMenuRights WHERE (PageTitle = '" + SpecialAccessRightName.RemoveChallan + "') AND (UserTypeId = '" + Session["UserType"].ToString() + "') AND (BranchId = '" + Globals.BranchID + "')"; cmd.CommandType = CommandType.Text; sdr = PrjClass.ExecuteReader(cmd); string statue = string.Empty; if (sdr.Read()) { statue = "" + sdr.GetValue(0); } if (statue == "True") { chkRemove.Attributes.Add("style", "display: inline"); } else { chkRemove.Attributes.Add("style", "display: none"); } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } }
public string SaveNewList(int copyListId, string newListName, string branchId) { var sqlCommand = new SqlCommand { CommandText = "sp_ItemWisePriceList", CommandType = CommandType.StoredProcedure }; sqlCommand.Parameters.AddWithValue("@BranchId", branchId); sqlCommand.Parameters.AddWithValue("@Flag", 7); if (copyListId == -1) { sqlCommand.Parameters.AddWithValue("@prevList", 0); sqlCommand.Parameters.AddWithValue("@IsInsertingBlankList", true); } else { sqlCommand.Parameters.AddWithValue("@prevList", copyListId); } sqlCommand.Parameters.AddWithValue("@newList", newListName); return(PrjClass.ExecuteNonQuery(sqlCommand)); }
public string SaveNewItemprice(DTO.NewPriceLists Ob) { string Result = string.Empty; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_itempricelistinsertdata"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ItemCode", Ob.ItemCode); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@ItemSubItemRef", Ob.SubItemRefID); cmd.Parameters.AddWithValue("@ItemCategoryId", Ob.CategoryID); cmd.Parameters.AddWithValue("@ItemVariationId", Ob.VariationId); cmd.Parameters.AddWithValue("@Processid", Ob.Processid); cmd.Parameters.AddWithValue("@Price", Ob.Price); cmd.Parameters.AddWithValue("@DateCreated", Ob.DateCreated); cmd.Parameters.AddWithValue("@DateModified", Ob.DateModified); cmd.Parameters.AddWithValue("@Active", Ob.Active); cmd.Parameters.AddWithValue("@Flag", 1); Result = PrjClass.ExecuteNonQuery(cmd); cmd.Dispose(); return(Result); }
public bool CheckAcceptPaymentButtonAcess(string BID, string UserTypeId) { SqlCommand CMD = new SqlCommand(); DataSet ds = new DataSet(); CMD.CommandType = CommandType.StoredProcedure; CMD.CommandText = "sp_Dry_BarcodeMaster"; CMD.Parameters.AddWithValue("@BranchId", BID); CMD.Parameters.AddWithValue("@UserTypeId", UserTypeId); CMD.Parameters.AddWithValue("@Flag", 33); ds = PrjClass.GetData(CMD); if (ds.Tables[0].Rows[0]["RightToView"].ToString() == "True") { status = true; } else { status = false; } return(status); }
public DataSet SearchCUstomer(DTO.CustomerMaster Ob) { SqlCommand cmd = new SqlCommand(); DataSet ds = new DataSet(); cmd.CommandText = "sp_CustomerNewMaster"; cmd.CommandType = CommandType.StoredProcedure; if (Ob.CustomerName != "") { cmd.Parameters.Add("@BranchId", Ob.BranchId); cmd.Parameters.Add("@CustomerName", Ob.CustomerName); cmd.Parameters.Add("@Flag", 5); } else { cmd.Parameters.Add("@BranchId", Ob.BranchId); cmd.Parameters.Add("@BookingNumber", Ob.BookingNumber); cmd.Parameters.Add("@flag", 4); } ds = PrjClass.GetData(cmd); return(ds); }
public string FindTaxActive(string BID) { string resultPrc = string.Empty, result = string.Empty; string resultApply = string.Empty; string resultRate = string.Empty; SqlDataReader sdr = null; SqlCommand cmd = new SqlCommand(); try { cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 9); sdr = PrjClass.ExecuteReader(cmd); while (sdr.Read()) { resultPrc += sdr.GetString(0).ToUpperInvariant() + ":"; resultApply += sdr.GetValue(1).ToString().ToUpperInvariant() + ":"; resultRate += sdr.GetValue(2).ToString().ToUpperInvariant() + ":"; } resultPrc = resultPrc.Substring(0, resultPrc.Length - 1); resultApply = resultApply.Substring(0, resultApply.Length - 1); resultRate = resultRate.Substring(0, resultRate.Length - 1); result = resultPrc + "_" + resultApply + "_" + resultRate; } catch (Exception ex) { return(""); } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(result); }
protected void grdsms_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = grdsms.SelectedRow; int Rowno = row.RowIndex; lblUpdateId.Text = ((Label)grdsms.Rows[Rowno].FindControl("lblId")).Text; PrjClass.SetItemInDropDown(drpDefaultMsg, ((Label)grdsms.Rows[Rowno].FindControl("lblDefaultMsg")).Text, true, false); txttemplate.Text = grdsms.SelectedRow.Cells[1].Text; if (txttemplate.Text == "No Message") { txttemplate.Enabled = false; } else { txttemplate.Enabled = true; } txtmessage.Text = grdsms.SelectedRow.Cells[3].Text; txttemplate.Focus(); txttemplate.Attributes.Add("onfocus", "javascript:select();"); btnEdit.Visible = true; btnSave.Visible = false; btnDelete.Visible = true; }
protected void btnExport_Click(object sender, EventArgs e) { string strRepTitle = grdChallan.Caption; string[] Resp = PrjClass.GenerateExcelReportFromGridView(grdChallan, strRepTitle); if (Resp[0] == "1") { Response.Redirect(Resp[1]); } else { lblMsg.Text = Resp[1]; Resp = PrjClass.GenerateCSVReportFromGridView(grdChallan, strRepTitle); if (Resp[0] == "1") { Response.Redirect(Resp[1]); } else { lblMsg.Text = " Could not provide Report at the time. Please try after some time." + Resp[1]; } } }
protected void grdSearchResult_SelectedIndexChanged(object sender, EventArgs e) { _barCode = ((Label)grdSearchResult.SelectedRow.FindControl("lblUserBarcode")).Text; _Pin = ((Label)grdSearchResult.SelectedRow.FindControl("lblUserPin")).Text; txtUserId.Text = grdSearchResult.SelectedRow.Cells[1].Text.Replace(" ", ""); EnableAndDisableControl(); hdnId.Value = grdSearchResult.SelectedRow.Cells[1].Text.Replace(" ", ""); PrjClass.SetItemInDropDown(drpUserType, grdSearchResult.SelectedRow.Cells[2].Text, true, false); txtUserName.Text = grdSearchResult.SelectedRow.Cells[3].Text.Replace(" ", ""); txtUserAddress.Text = grdSearchResult.SelectedRow.Cells[4].Text.Replace(" ", ""); txtUserPhone.Text = grdSearchResult.SelectedRow.Cells[5].Text.Replace(" ", ""); txtUserMobile.Text = grdSearchResult.SelectedRow.Cells[6].Text.Replace(" ", ""); txtUserEmailId.Text = grdSearchResult.SelectedRow.Cells[7].Text.Replace(" ", ""); txtUserbarcode.Text = ((Label)grdSearchResult.SelectedRow.FindControl("lblUserBarcode")).Text; txtUserPin.Text = ((Label)grdSearchResult.SelectedRow.FindControl("lblUserPin")).Text; chkActive.Checked = ((CheckBox)grdSearchResult.SelectedRow.FindControl("chkActive")).Checked; txtUserPassword.Attributes.Add("Value", ((Label)grdSearchResult.SelectedRow.FindControl("lblUserPassword")).Text); btnSave.Visible = false; btnEdit.Visible = true; checkUpdatePassword.Visible = true; txtUserId.Focus(); txtUserId.Attributes.Add("onfocus", "javascript:select();"); }
public string UpdateColor(DTO.Common Ob) { string res = ""; if (Ob.Path != Ob.Input) { if (CheckDuplicateColor(Ob) == true) { res = "Record allready exist."; return(res); } } SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_NewColorMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ColorName", Ob.Input); cmd.Parameters.AddWithValue("@ID ", Ob.Id); cmd.Parameters.AddWithValue("@BranchId", Ob.BID); cmd.Parameters.AddWithValue("@Flag", "2"); res = PrjClass.ExecuteNonQuery(cmd); return(res); }
private void SetCurrenyType() { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; try { cmd.CommandText = "SELECT CurrencyType FROM mstReceiptConfig WHERE (BranchId = '" + Globals.BranchID + "') "; cmd.CommandType = CommandType.Text; sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { _CurrencyType = "" + sdr.GetValue(0).ToString(); } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } }
public string[] GetAllItemsDetailed(string branchId) { SqlCommand sqlCommand = new SqlCommand { CommandText = "sp_Item", CommandType = CommandType.StoredProcedure }; sqlCommand.Parameters.AddWithValue("@BranchId", branchId); sqlCommand.Parameters.AddWithValue("@Flag", 21); var sqlDataReader = PrjClass.ExecuteReader(sqlCommand); var allItems = new List <string>(); while (sqlDataReader != null && sqlDataReader.Read()) { allItems.Add(sqlDataReader.GetString(0)); } if (sqlDataReader != null) { sqlDataReader.Close(); } return(allItems.ToArray()); }
protected void btnPrint_Click(object sender, EventArgs e) { string reportType = "PDF"; string mimeType; string encoding; string fileNameExtension; string deviceInfo = "<DeviceInfo>" + " <OutputFormat>PDF</OutputFormat>" + " <PageWidth>10in</PageWidth>" + " <PageHeight>11in</PageHeight>" + " <MarginTop>0.2in</MarginTop>" + " <MarginLeft>1in</MarginLeft>" + " <MarginRight>.5in</MarginRight>" + " <MarginBottom>0.2in</MarginBottom>" + "</DeviceInfo>"; Warning[] warnings; string[] streams; byte[] renderedBytes; renderedBytes = ReportViewer1.LocalReport.Render( reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings); var fileName = "OutPut.pdf"; PrjClass.ShowPdfFromRdlc(this.Page, renderedBytes, fileName); //Response.Clear(); //Response.ContentType = mimeType; //Response.BinaryWrite(renderedBytes); //Response.End(); }