public string GetsmsTemplateName(string BID, string smsId) { SqlCommand cmd = new SqlCommand(); string res = string.Empty; SqlDataReader sdr = null; try { cmd.CommandText = "SP_smsconfig"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@smsId", smsId); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 17); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { res = sdr.GetValue(0).ToString(); } else { res = ""; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(res); }
public string GetWorkShopName(string BID, string ChallanNo) { string res = ""; SqlDataReader sdr = null; SqlCommand cmd = new SqlCommand(); try { cmd.CommandText = "sp_ChallanInProc"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@ChallanNumber", ChallanNo); cmd.Parameters.AddWithValue("@Flag", 19); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { res = sdr.GetValue(0).ToString(); } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(res); }
public string SetButtonAccordingMenuRights(string BID, string PageName, string UID) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; string statue = string.Empty; try { cmd.CommandText = "sp_Dry_DrawlMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@PageTitle", PageName); cmd.Parameters.AddWithValue("@UserTypeId", UID); cmd.Parameters.AddWithValue("@Flag", 37); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { statue = "" + sdr.GetValue(0); } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(statue); }
public float getPriceAccordingProcess(string BID, string Process, string itemName, int rateListId) { float rate = 0; SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; try { cmd.CommandText = "sp_City"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Process); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@ItemName", itemName); cmd.Parameters.AddWithValue("@RateListId", rateListId); cmd.Parameters.AddWithValue("@Flag", 8); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { rate = float.Parse(sdr.GetValue(0).ToString()); } else { rate = 0; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(rate); }
public bool CheckItemStatus(DTO.Item Ob) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_Item"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ItemName", Ob.ItemName); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@Flag", "14"); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public bool CheckIfProcessCodeExits(string code, string BranchID) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_Item"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BranchID); cmd.Parameters.AddWithValue("@PrcCode", code); cmd.Parameters.AddWithValue("@Flag", 17); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public bool CheckRecord() { SqlCommand CMD = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { CMD.CommandText = "Proc_BarCodeLabels"; CMD.CommandType = CommandType.StoredProcedure; CMD.Parameters.AddWithValue("@Flag", 13); sdr = PrjClass.ExecuteReader(CMD); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); CMD.Dispose(); } return(status); }
private void SetTheProcesses() { var sqlCommand = new SqlCommand { CommandText = "sp_ItemWiseRate", CommandType = CommandType.StoredProcedure }; sqlCommand.Parameters.AddWithValue("@BranchId", Globals.BranchID); sqlCommand.Parameters.AddWithValue("@Flag", 2); var processList = string.Empty; var sqlDataReader = PrjClass.ExecuteReader(sqlCommand); while (sqlDataReader != null && sqlDataReader.Read()) { processList += sqlDataReader.GetString(0) + ":"; } if (sqlDataReader != null) { sqlDataReader.Close(); } if (processList.Length >= 1) { processList = processList.Substring(0, processList.Length - 1); } hdnProcesses.Value = processList; }
public string GetItemId(string BID, string ItemName, string ItemCode) { SqlDataReader sdr = null; string ItemId = string.Empty; SqlCommand cmd = new SqlCommand(); try { cmd.CommandText = "sp_NewBooking"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CustomerName", ItemName); cmd.Parameters.AddWithValue("@ItemCode", ItemCode); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 56); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { ItemId = sdr.GetValue(0).ToString(); } else { ItemId = ""; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(ItemId); }
public bool CheckCorrectItem(string BID, string ItemName) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_NewBooking"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CustomerName", ItemName); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 50); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public bool CheckDuplicateProcess(DTO.ProcessMaster Obj) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Obj.ProcessCode); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 7); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public string getCorrectProcess(string BID, string Process) { var res = string.Empty; SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; try { cmd.CommandText = "sp_City"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Process); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 9); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { res = sdr.GetValue(0).ToString(); } else { res = "Invalid Process"; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(res); }
public string GetDefaultProcessAndRateForRateList(string itemName, int rateListId, string branchId) { SqlDataReader sdr = null; var sqlCommand = new SqlCommand { CommandText = "sp_city", CommandType = CommandType.StoredProcedure }; sqlCommand.Parameters.AddWithValue("@ItemName", itemName); sqlCommand.Parameters.AddWithValue("@RateListId", rateListId); sqlCommand.Parameters.AddWithValue("@branchId", branchId); sqlCommand.Parameters.AddWithValue("@flag", 13); var ProcessAndRate = string.Empty; using (sdr = PrjClass.ExecuteReader(sqlCommand)) { while (sdr != null && sdr.Read()) { ProcessAndRate = sdr.GetValue(0).ToString(); ProcessAndRate += ":" + sdr.GetValue(1).ToString(); } } sdr.Close(); sdr.Dispose(); sqlCommand.Dispose(); return(ProcessAndRate); }
private bool CheckDuplicateReason(DTO.Common Ob) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_Dry_BarcodeMaster"; cmd.Parameters.AddWithValue("@BranchId", Ob.BID); cmd.Parameters.AddWithValue("@RemoveReason", Ob.Input); cmd.Parameters.AddWithValue("@Flag", 32); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public bool CheckCorrectRemoveReason(string BID, string Text) { SqlCommand CMD = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { CMD.CommandType = CommandType.StoredProcedure; CMD.CommandText = "sp_Dry_BarcodeMaster"; CMD.Parameters.AddWithValue("@BranchId", BID); CMD.Parameters.AddWithValue("@RemoveReason", Text); CMD.Parameters.AddWithValue("@Flag", 32); sdr = PrjClass.ExecuteReader(CMD); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); CMD.Dispose(); } return(status); }
public string findAllArea(string BID) { string resultArea = string.Empty; string resultAreaCode = string.Empty; SqlDataReader sdr = null; SqlCommand cmd = new SqlCommand(); try { cmd.CommandText = "sp_Area"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 7); sdr = PrjClass.ExecuteReader(cmd); while (sdr.Read()) { resultArea += sdr.GetValue(0).ToString().ToUpperInvariant() + ":"; resultAreaCode += sdr.GetValue(1).ToString().ToUpperInvariant() + ":"; } resultArea = resultArea.Substring(0, resultArea.Length - 1); resultAreaCode = resultAreaCode.Substring(0, resultAreaCode.Length - 1); var result = resultArea + "_" + resultAreaCode; return(result); } catch (Exception ex) { return(""); } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } }
public string GetQtyPackageDetails(int assignId, string branchId) { var str = new StringBuilder(); SqlDataReader rdr = null; SqlCommand cmd = new SqlCommand(); try { cmd.CommandText = "sp_PackageMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@AssignId", assignId); cmd.Parameters.AddWithValue("@BranchId", branchId); cmd.Parameters.AddWithValue("@Flag", 44); rdr = PrjClass.ExecuteReader(cmd); while (rdr != null && rdr.Read()) { str.Append(rdr["ItemName"] + ":"); str.Append(rdr["Qty"] + "_"); } if (str.Length != 0) { str.Remove(str.Length - 1, 1); } } catch (Exception ex) { } finally { rdr.Close(); rdr.Dispose(); cmd.Dispose(); } return(str.ToString()); }
public bool CheckPackageAssignToCustomer(DTO.PackageMaster Ob) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_PackageMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CustomerCode", Ob.CustomerCode); cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@Flag", 14); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public ArrayList getDateAndTimeAccordingToZoneTime(string BID) { string zoneTime = ""; ArrayList DateAndTime = new ArrayList(); SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; try { cmd.CommandText = "sp_ReceiptConfigSetting"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 2); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { zoneTime = "" + sdr.GetValue(54); TimeZoneInfo tst = TimeZoneInfo.FindSystemTimeZoneById(zoneTime); DateTime tstTime = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, tst); DateAndTime.Add(tstTime.Date.ToString("dd MMM yyyy")); DateAndTime.Add(tstTime.ToLongTimeString()); } } catch (Exception) { zoneTime = "India Standard Time"; } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(DateAndTime); }
public bool CheckBookingNumber(string BookingNumber, string BID) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_Dry_DrawlMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BookingNumber", BookingNumber); cmd.Parameters.AddWithValue("@BranchId", BID); cmd.Parameters.AddWithValue("@Flag", 33); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public bool CheckReadyClothSendSms(string BID) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "Sp_Sel_ChallanScreenSms"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", BID); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
private int CountTotalBooking(DTO.ProcessMaster Obj) { SqlDataReader sdr = null; SqlCommand cmd = new SqlCommand(); int TotalItems = 0; try { cmd.CommandText = "sp_sp_ProcessMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProcessCode", Obj.ProcessCode); cmd.Parameters.AddWithValue("@BranchId", Obj.BID); cmd.Parameters.AddWithValue("@Flag", 6); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { TotalItems = int.Parse("0" + sdr.GetValue(0)); } else { TotalItems = 0; } } catch (Exception) { TotalItems = 0; } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(TotalItems); }
private bool CheckRecord(DTO.BranchMaster Ob) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; bool status = false; try { cmd.CommandText = "sp_BranchMaster"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", Ob.BranchId); cmd.Parameters.AddWithValue("@Flag", 5); sdr = PrjClass.ExecuteReader(cmd); if (sdr.Read()) { status = true; } else { status = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } return(status); }
public SqlDataReader ReadProcessRate(DTO.Common Ob) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; cmd.CommandText = "sp_ItemWisePriceList"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@BranchId", Ob.BID); cmd.Parameters.AddWithValue("@ItemName", Ob.Input); cmd.Parameters.AddWithValue("@Flag", 3); sdr = PrjClass.ExecuteReader(cmd); return(sdr); }
private void ButtonTrueFalse(string dropvalue) { SqlCommand cmd = new SqlCommand(); SqlDataReader sdr = null; try { cmd.CommandText = "SELECT RightToView FROM dbo.EntMenuRights WHERE (PageTitle = '" + SpecialAccessRightName.MulPaymentAcpRight + "') 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") { if (drpSelectOption.SelectedValue == "1") { btnDeliverClothes.Visible = true; btnAcceptPayment.Visible = false; btnDeliverAndPayment.Visible = false; } if (drpSelectOption.SelectedValue == "2") { btnDeliverClothes.Visible = false; btnAcceptPayment.Visible = true; btnDeliverAndPayment.Visible = false; } if (drpSelectOption.SelectedValue == "3") { btnDeliverClothes.Visible = false; btnAcceptPayment.Visible = false; btnDeliverAndPayment.Visible = true; } } else { btnDeliverClothes.Visible = false; btnAcceptPayment.Visible = false; btnDeliverAndPayment.Visible = false; } } catch (Exception ex) { } finally { sdr.Close(); sdr.Dispose(); cmd.Dispose(); } }
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 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 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); }
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 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); }