Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
    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();
        }
    }
Ejemplo n.º 8
0
        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);
            }
        }
Ejemplo n.º 9
0
 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);
 }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
 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;
     }
 }
Ejemplo n.º 16
0
        /// <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);
        }
Ejemplo n.º 17
0
        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());
        }
Ejemplo n.º 18
0
        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();
            }
        }
Ejemplo n.º 19
0
        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));
        }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
0
        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];
            }
        }
    }
Ejemplo n.º 26
0
 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("&nbsp;", "");
     EnableAndDisableControl();
     hdnId.Value = grdSearchResult.SelectedRow.Cells[1].Text.Replace("&nbsp;", "");
     PrjClass.SetItemInDropDown(drpUserType, grdSearchResult.SelectedRow.Cells[2].Text, true, false);
     txtUserName.Text    = grdSearchResult.SelectedRow.Cells[3].Text.Replace("&nbsp;", "");
     txtUserAddress.Text = grdSearchResult.SelectedRow.Cells[4].Text.Replace("&nbsp;", "");
     txtUserPhone.Text   = grdSearchResult.SelectedRow.Cells[5].Text.Replace("&nbsp;", "");
     txtUserMobile.Text  = grdSearchResult.SelectedRow.Cells[6].Text.Replace("&nbsp;", "");
     txtUserEmailId.Text = grdSearchResult.SelectedRow.Cells[7].Text.Replace("&nbsp;", "");
     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();");
 }
Ejemplo n.º 27
0
        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();
            }
        }
Ejemplo n.º 29
0
        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());
        }
Ejemplo n.º 30
0
        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();
        }