Exemplo n.º 1
0
        protected void grdSearchResult_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblUpdateId.Text   = grdSearchResult.SelectedRow.Cells[1].Text == " " ? "" : grdSearchResult.SelectedRow.Cells[1].Text;
            txtEntryDate.Text  = grdSearchResult.SelectedRow.Cells[2].Text == " " ? "" : grdSearchResult.SelectedRow.Cells[2].Text;
            txtRemark.Text     = grdSearchResult.SelectedRow.Cells[3].Text == " " ? "" : grdSearchResult.SelectedRow.Cells[3].Text;
            txtPaidAmount.Text = ((Label)grdSearchResult.SelectedRow.FindControl("lblAmount")).Text;
            PrjClass.SetItemInDropDown(cmbDrExpenses1, ((Label)grdSearchResult.SelectedRow.FindControl("lblAccountType")).Text, true, false);
            txtEntryDate.Attributes.Add("onfocus", "javascript:select();");
            txtEntryDate.Focus();
            btnAddNewExpense.Visible = false;
            btnDelete.Visible        = true;
            btnUpdate.Visible        = true;
            btnRename.Visible        = true;
            bool rights  = AppClass.CheckButtonRights(SpecialAccessRightName.LedgerRight);
            bool rights1 = AppClass.CheckButtonRights(SpecialAccessRightName.EditAndDelExp);

            if (rights == true)
            {
                btnRename.Visible = true;
            }
            else
            {
                btnRename.Visible = false;
            }
            if (rights1 == true)
            {
                btnDelete.Visible = true;
                btnUpdate.Visible = true;
            }
            else
            {
                btnDelete.Visible = false;
                btnUpdate.Visible = false;
            }
        }
Exemplo n.º 2
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(" ", "");
        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[4].Text.Replace(" ", "");
        txtUserMobile.Text    = grdSearchResult.SelectedRow.Cells[4].Text.Replace(" ", "");
        txtUserEmailId.Text   = grdSearchResult.SelectedRow.Cells[5].Text.Replace(" ", "");
        txtUserbarcode.Text   = ((Label)grdSearchResult.SelectedRow.FindControl("lblUserBarcode")).Text;
        txtUserPin.Text       = ((Label)grdSearchResult.SelectedRow.FindControl("lblUserPin")).Text;
        hdntempUserName.Value = txtUserName.Text;
        string strActive = grdSearchResult.SelectedRow.Cells[6].Text;

        if (strActive == "Yes")
        {
            chkActive.Checked = true;
        }
        else
        {
            chkActive.Checked = false;
        }
        // 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();");
        EnableAndDisableControl();
    }
Exemplo n.º 3
0
    private void ShowBranchDetails(string BranchId)
    {
        DataSet dsMain = new DataSet();

        try
        {
            Ob.BranchId = BranchId;
            dsMain      = BAL.BALFactory.Instance.BL_Branch.FillTextBoxes(Ob);
            if (dsMain.Tables[0].Rows.Count > 0)
            {
                txtBranchName.Text    = dsMain.Tables[0].Rows[0]["BranchName"].ToString();
                txtBranchAddress.Text = dsMain.Tables[0].Rows[0]["BranchAddress"].ToString();
                //  txtBranchPhone.Text = dsMain.Tables[0].Rows[0]["BranchPhone"].ToString();
                txtBranchSlogan.Text     = dsMain.Tables[0].Rows[0]["BranchSlogan"].ToString();
                txtBranchCode.Text       = dsMain.Tables[0].Rows[0]["BranchCode"].ToString();
                rdrBranch.Checked        = (dsMain.Tables[0].Rows[0]["IsFactory"].ToString() == "False" ? true : false);
                rdrFactory.Checked       = (dsMain.Tables[0].Rows[0]["IsFactory"].ToString() == "True" ? true : false);
                chkChallan.Checked       = Convert.ToBoolean(dsMain.Tables[0].Rows[0]["IsChallan"].ToString());
                txtMobileNo.Text         = dsMain.Tables[0].Rows[0]["BranchMobile"].ToString();
                txtEmailId.Text          = dsMain.Tables[0].Rows[0]["BranchEmail"].ToString();
                txtBusinessName.Text     = dsMain.Tables[0].Rows[0]["BusinessName"].ToString();
                chkOperatingTime.Checked = (dsMain.Tables[0].Rows[0]["IsLoginTime"].ToString() == "True" ? true : false);
                if (dsMain.Tables[0].Rows[0]["IsLoginTime"].ToString() == "True")
                {
                    divTiming.Attributes.Add("style", "display:block");
                }
                else
                {
                    divTiming.Attributes.Add("style", "display:none");
                }
                txtStartTime.Text = dsMain.Tables[0].Rows[0]["LoginStartTime"].ToString();
                txtEndTime.Text   = dsMain.Tables[0].Rows[0]["LoginEndTime"].ToString();

                txtBranchCode.Focus();
                txtBranchCode.Attributes.Add("onfocus", "javascript:select();");
                if (rdrFactory.Checked)
                {
                    chkChallan.Visible = false;
                }
                else
                {
                    chkChallan.Visible = true;
                }
                hdnBranchId.Value = dsMain.Tables[0].Rows[0]["BranchId"].ToString();

                if (dsMain.Tables[1].Rows.Count > 0)
                {
                    PrjClass.SetItemInDropDown(drpWeekend, dsMain.Tables[1].Rows[0]["weeklyoff"].ToString(), true, false);
                }
            }
        }
        catch (Exception excp)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
            lblErr.Text = "Error ShowBranchDetails(): " + excp.Message;
        }
        finally
        {
        }
    }
Exemplo n.º 4
0
        private void fetchapisetting()
        {
            DataSet ds = new DataSet();

            Ob.BranchId = Globals.BranchID;
            ds          = BAL.BALFactory.Instance.BAL_sms.fetchapi(Ob);
            if (ds.Tables[0].Rows.Count > 0)
            {
                txtuserName.Text = ds.Tables[0].Rows[0]["userid"].ToString();
                txtpassword.Text = ds.Tables[0].Rows[0]["password"].ToString();
                txtapi.Text      = ds.Tables[0].Rows[0]["api"].ToString();
                Txtsenderid.Text = ds.Tables[0].Rows[0]["senderid"].ToString();

                Txtsenderidpreview.Text = ds.Tables[0].Rows[0]["senderdemo"].ToString();
                txtusernamepreview.Text = ds.Tables[0].Rows[0]["useriddemo"].ToString();
                txtpasswordpreview.Text = ds.Tables[0].Rows[0]["passworddemo"].ToString();
                Txtmassagepreview.Text  = ds.Tables[0].Rows[0]["massagedemo"].ToString();
                txtmobile.Text          = ds.Tables[0].Rows[0]["mobiledemo"].ToString();
                PrjClass.SetItemInDropDown(Drpsender, ds.Tables[0].Rows[0]["senderposition"].ToString(), true, false);
                PrjClass.SetItemInDropDown(Drpusername, ds.Tables[0].Rows[0]["userposition"].ToString(), true, false);
                PrjClass.SetItemInDropDown(Drppassword, ds.Tables[0].Rows[0]["passwordposition"].ToString(), true, false);
                PrjClass.SetItemInDropDown(Drpmobile, ds.Tables[0].Rows[0]["mobileposition"].ToString(), true, false);
                PrjClass.SetItemInDropDown(Drpmassage, ds.Tables[0].Rows[0]["massageposition"].ToString(), true, false);
            }
        }
        private void binddrpdefaultsms()
        {
            DTO.sms Ob = new DTO.sms();
            DataSet ds = new DataSet();

            Ob.BranchId = Globals.BranchID;
            ds          = BAL.BALFactory.Instance.BAL_sms.fetchdropdelivery(Ob);
            PrjClass.SetItemInDropDown(drpsmstemplate, ds.Tables[4].Rows[0]["Template"].ToString(), true, false);
        }
Exemplo n.º 6
0
    private void ShowChallanDetails(string strStartDate, string strToDate)
    {
        grdReport.DataSource = null;
        grdReport.DataBind();
        ViewState["Date"]  = DateTime.Parse(strStartDate).ToString("dd MMM yyyy");
        ViewState["Date1"] = DateTime.Parse(strToDate).AddDays(-1).ToString("dd MMM yyyy");
        SqlCommand cmd = new SqlCommand();

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Sp_Report_ChallanReport";
        cmd.Parameters.Add(new SqlParameter("@ChallanDate1", strStartDate));
        cmd.Parameters.Add(new SqlParameter("@ChallanDate2", strToDate));
        cmd.Parameters.Add(new SqlParameter("@BranchId", Globals.BranchID));
        cmd.Parameters.Add(new SqlParameter("@Flag", 3));

        SqlConnection  sqlcon = new SqlConnection(PrjClass.sqlConStr);
        SqlDataAdapter sadp   = new SqlDataAdapter();
        DataSet        dsMain = new DataSet();

        try
        {
            sqlcon.Open();
            cmd.Connection     = sqlcon;
            sadp.SelectCommand = cmd;
            sadp.Fill(dsMain);
            if (dsMain.Tables.Count > 0)
            {
                if (dsMain.Tables[0].Rows.Count > 0)
                {
                    if (dsMain.Tables[0].Columns[0].ColumnName == "Error")
                    {
                        throw new Exception(dsMain.Tables[0].Rows[0][1].ToString());
                    }
                    grdReport.DataSource = dsMain.Tables[0];
                    grdReport.DataBind();
                }
            }
        }
        catch (Exception excp)
        {
            lblErr.Text = "Error : " + excp.Message;
        }
        finally
        {
            sqlcon.Close();
            sqlcon.Dispose();
            if (dsMain.Tables[0].Rows.Count > 0)
            {
                string Challantype = dsMain.Tables[0].Rows[0]["ChallanType"].ToString();
                for (int i = 0; i < grdReport.Rows.Count; i++)
                {
                    PrjClass.SetItemInDropDown(((DropDownList)grdReport.Rows[i].FindControl("drpOption")), Challantype, true, false);
                }
            }
        }
    }
Exemplo n.º 7
0
    protected void btnTemp_Click(object sender, EventArgs e)
    {
        try
        {
            itemname = txtItemNameSearch.Text.Split('-');
            txtItemNameSearch.Text = itemname[1].Trim();
            if (BAL.BALFactory.Instance.Bal_Processmaster.CheckCorrectItem(Globals.BranchID, itemname[1].Trim()) == false)
            {
                Session["ReturnMsg"] = "Please enter valid item name.";
                txtItemNameSearch.Focus();
                txtItemNameSearch.Attributes.Add("onfocus", "javascript:select();");
            }
        }
        catch (Exception ex)
        {
            Session["ReturnMsg"] = "Please enter valid item name.";
            txtItemNameSearch.Focus();
            txtItemNameSearch.Attributes.Add("onfocus", "javascript:select();");
        }
        ClearRates();
        SqlDataReader sdr = null;
        string        strColProcess = "", strGrdProcess = "";

        try
        {
            Ob.BID   = Globals.BranchID;
            Ob.Input = itemname[1].Trim();
            sdr      = BAL.BALFactory.Instance.BL_PriceList.ReadProcessRate(Ob);
            while (sdr.Read())
            {
                strColProcess = "" + sdr.GetValue(1);
                for (int r = 0; r < grdTable.Rows.Count; r++)
                {
                    strGrdProcess = ((HiddenField)grdTable.Rows[r].FindControl("hdnProcessCode")).Value;
                    if (strColProcess == strGrdProcess)
                    {
                        ((TextBox)grdTable.Rows[r].Cells[1].FindControl("txtProcessRate")).Text = "" + sdr.GetValue(2);
                        break;
                    }
                }
            }
            grdTable.Caption = "Rates for " + txtItemNameSearch.Text;
            ((TextBox)grdTable.Rows[0].Cells[1].FindControl("txtProcessRate")).Focus();
            ((TextBox)grdTable.Rows[0].Cells[1].FindControl("txtProcessRate")).Attributes.Add("onfocus", "javascript:select();");
            PrjClass.SetItemInDropDown(drpItemNames, itemname[1].Trim(), true, false);
            stylebutton     = "<span class='Legend'>Item Name :</span>";
            btnSave.Visible = true;
        }
        catch (Exception ex) { }
        finally
        {
            sdr.Close();
            sdr.Dispose();
        }
    }
Exemplo n.º 8
0
        public void FetchDropDownFont(DataSet ds)
        {
            /* Drop Down Booking fill through Database */

            PrjClass.SetItemInDropDown(drpBookingFont, ds.Tables[0].Rows[0]["bookingfont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpBookingSize, ds.Tables[0].Rows[0]["bookingsize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpBookingAlign, ds.Tables[0].Rows[0]["bookingalign"].ToString(), true, false);

            /* Drop Down Process fill through Database */
            PrjClass.SetItemInDropDown(drpProcessFont, ds.Tables[0].Rows[0]["processfont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpProcessSize, ds.Tables[0].Rows[0]["processsize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpRemarkAlign, ds.Tables[0].Rows[0]["processalign"].ToString(), true, false);

            /* Drop Down Remarks fill through Database */
            PrjClass.SetItemInDropDown(drpRemarkFont, ds.Tables[0].Rows[0]["remarkfont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpRemarkSize, ds.Tables[0].Rows[0]["remarksize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpRemarkAlign, ds.Tables[0].Rows[0]["remarkremarkalign"].ToString(), true, false);

            /* Drop Down BarCode fill through Database */
            PrjClass.SetItemInDropDown(drpBarCodeAlign, ds.Tables[0].Rows[0]["barcodealign"].ToString(), true, false);

            /* Drop Down DueDate fill through Database */
            PrjClass.SetItemInDropDown(drpDueDateFont, ds.Tables[0].Rows[0]["itemfont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpDueDateAlign, ds.Tables[0].Rows[0]["itemalign"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpDueDateSize, ds.Tables[0].Rows[0]["itemsize"].ToString(), true, false);

            /* Drop Down Items fill through Database */
            PrjClass.SetItemInDropDown(drpItemNameFont, ds.Tables[0].Rows[0]["itemfont1"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpItemNameSize, ds.Tables[0].Rows[0]["itemsize1"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpItemNameAlign, ds.Tables[0].Rows[0]["itemalign1"].ToString(), true, false);

            /* Drop Down Customer fill through Database */
            PrjClass.SetItemInDropDown(drpCustomerFont, ds.Tables[0].Rows[0]["cusfont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpCustomerSize, ds.Tables[0].Rows[0]["cussize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpCustomerAlign, ds.Tables[0].Rows[0]["cusalign"].ToString(), true, false);

            /* Drop Down Address fill through Database */
            PrjClass.SetItemInDropDown(drpAddressFont, ds.Tables[0].Rows[0]["addfont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpAddressSize, ds.Tables[0].Rows[0]["addsize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpAddressAlign, ds.Tables[0].Rows[0]["addalign"].ToString(), true, false);

            /* Drop Down BookingDate fill through Database */
            PrjClass.SetItemInDropDown(drpBDateFont, ds.Tables[0].Rows[0]["BDateFont"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpBDateSize, ds.Tables[0].Rows[0]["BDateSize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpBDateAlign, ds.Tables[0].Rows[0]["BdateAlign"].ToString(), true, false);

            PrjClass.SetItemInDropDown(drpShopSize, ds.Tables[0].Rows[0]["ShopSize"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpShopSize, ds.Tables[0].Rows[0]["ShopAlign"].ToString(), true, false);

            PrjClass.SetItemInDropDown(drpBarCodeFonts, ds.Tables[0].Rows[0]["BarCodeFontName"].ToString(), true, false);
            BAL.BALFactory.Instance.BAL_Barcodesetting.BarCodeFontSize(drpBarCodeFonts, drpBarCodeSize);
            PrjClass.SetItemInDropDown(drpBarCodeSize, ds.Tables[0].Rows[0]["BarCodeFontSize"].ToString(), true, false);
        }
Exemplo n.º 9
0
        protected void grdHoliday_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row   = grdHoliday.SelectedRow;
            int         Rowno = row.RowIndex;

            hdnId.Value = ((Label)grdHoliday.Rows[Rowno].FindControl("lblId")).Text;
            PrjClass.SetItemInDropDown(drpWeekend, ((Label)grdHoliday.Rows[Rowno].FindControl("lblWeek")).Text, true, false);
            txtHolidayDescription.Text = grdHoliday.SelectedRow.Cells[3].Text;
            txtHolidayDate.Text        = grdHoliday.SelectedRow.Cells[4].Text;
            btnHolidaySave.Visible     = false;
            btnUpdate.Visible          = true;
            btnDelete.Visible          = true;
        }
Exemplo n.º 10
0
        private void Showdata()
        {
            SqlCommand cmd = new SqlCommand();
            DataSet    ds  = new DataSet();

            cmd.CommandText = "sp_ReceiptConfigSetting";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@BranchId", Globals.BranchID);
            cmd.Parameters.AddWithValue("@Flag", 11);
            ds = PrjClass.GetData(cmd);
            PrjClass.SetItemInDropDown(Drpdrive, ds.Tables[0].Rows[0]["backupdrive"].ToString(), true, false);
            txtEmailID.Text = ds.Tables[0].Rows[0]["BackUpEmailID"].ToString();
            // PrjClass.SetItemInDropDown(Drpfloder, ds.Tables[0].Rows[0]["backuppath"].ToString(), true, false);
        }
Exemplo n.º 11
0
        private void BindGrid(string strSearchBy)
        {
            Ob.description = strSearchBy;
            Ob.BranchId    = Globals.BranchID;
            DataSet ds = new DataSet();

            ds = BAL.BALFactory.Instance.BL_HolidayMaster.BindGridView(Ob);
            grdHoliday.DataSource = BAL.BALFactory.Instance.BL_HolidayMaster.BindGridView(Ob);
            grdHoliday.DataBind();
            if (ds.Tables[1].Rows.Count > 0)
            {
                PrjClass.SetItemInDropDown(drpWeekend, ds.Tables[1].Rows[0]["weeklyoff"].ToString(), true, false);
            }
        }
    private void BindDropDown()
    {
        SqlCommand cmd = new SqlCommand();
        DataSet    ds  = new DataSet();

        cmd.CommandText = "sp_Dry_DrawlMaster";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@BranchId", Globals.BranchID);
        cmd.Parameters.AddWithValue("@Flag", 28);
        ds = AppClass.GetData(cmd);
        if (ds.Tables[0].Rows.Count > 0)
        {
            PrjClass.SetItemInDropDown(drpBookingPreFix, ds.Tables[0].Rows[0]["BookingPreFix"].ToString(), false, false);
        }
    }
Exemplo n.º 13
0
        private void binddrpdefault()
        {
            DTO.sms Ob = new DTO.sms();
            DataSet ds = new DataSet();

            Ob.BranchId = Globals.BranchID;
            ds          = BAL.BALFactory.Instance.BAL_sms.fetchdropdelivery(Ob);
            PrjClass.SetItemInDropDown(Drpnewbooking, ds.Tables[3].Rows[0]["Template"].ToString(), true, false);
            PrjClass.SetItemInDropDown(Drpclothready, ds.Tables[1].Rows[0]["Template"].ToString(), true, false);
            PrjClass.SetItemInDropDown(drpdelivery, ds.Tables[2].Rows[0]["Template"].ToString(), true, false);
            if (ds.Tables[0].Rows.Count > 0)
            {
                btpreview_Click(null, null);
            }
        }
Exemplo n.º 14
0
 public void FetchDropDownPosition(DataSet ds)
 {
     PrjClass.SetItemInDropDown(drpBookingPosition, ds.Tables[0].Rows[0]["bookingnoposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpCustomerPosition, ds.Tables[0].Rows[0]["cusposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpProcessPosition, ds.Tables[0].Rows[0]["processposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpRemarkPosition, ds.Tables[0].Rows[0]["remarkposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpBarCodePosition, ds.Tables[0].Rows[0]["barcodeposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpDueDatePosition, ds.Tables[0].Rows[0]["itemposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpItemNamePosition, ds.Tables[0].Rows[0]["itemposition1"].ToString(), true, false);
     PrjClass.SetItemInDropDown(DrpAddressPosition, ds.Tables[0].Rows[0]["Addressposition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpBDatePosition, ds.Tables[0].Rows[0]["BDatePosition"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpHeight, ds.Tables[0].Rows[0]["barcodeheight"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpWidth, ds.Tables[0].Rows[0]["barcodewidth"].ToString(), true, false);
     //PrjClass.SetItemInDropDown(drpPrinterlist, ds.Tables[0].Rows[0]["PrinterName"].ToString(), true, false);
     PrjClass.SetItemInDropDown(drpBlank, ds.Tables[0].Rows[0]["LogoSize"].ToString(), true, false);
     hdnValue.Value = ds.Tables[0].Rows[0]["PrinterName"].ToString();
 }
Exemplo n.º 15
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();
        }
    }
Exemplo n.º 16
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;
        }
Exemplo n.º 17
0
    protected void btnAddNewPriority_Click(object sender, EventArgs e)
    {
        if (txtNewPriority.Text == "")
        {
            lblErr.Text = "No new priority was provided to add.";
            return;
        }
        string res = string.Empty;

        Ob.BranchId     = Globals.BranchID;
        Ob.CustomerName = txtNewPriority.Text;
        res             = BAL.BALFactory.Instance.BL_CustomerMaster.SavePriority(Ob);
        if (res == "Record Saved")
        {
            BindPriroity();
            PrjClass.SetItemInDropDown(drpPriority, txtNewPriority.Text, true, false);
            txtNewPriority.Text = "";
            drpPriority.Focus();
        }
        else
        {
            lblErr.Text = " Duplicate Priority was provided.";
        }
    }
Exemplo n.º 18
0
        protected void btnSearchInvoice_Click(object sender, EventArgs e)
        {
            int           status = 0;
            SqlCommand    cmd    = new SqlCommand();
            SqlDataReader sdr    = null;

            try
            {
                divInvoiceDetail.Visible = false;
                BookingNo = txtBarcode.Text.Split('-');
                int BookingNoLength = BookingNo.Length;


                cmd.CommandText = "sp_Dry_EmployeeMaster";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Flag", 11);
                cmd.Parameters.AddWithValue("@BookingNumber", BookingNo[0]);
                if (BookingNo.Length == 1 || BookingNo.Length == 3)
                {
                    if (BookingNo.Length == 1)
                    {
                        cmd.Parameters.AddWithValue("@BranchId", drpBranch.SelectedItem.Value);
                    }
                    else
                    {
                        cmd.Parameters.AddWithValue("@BranchId", BookingNo[2]);
                    }
                }
                sdr = AppClass.ExecuteReader(cmd);
                var assignId = string.Empty;
                if (sdr.Read())
                {
                    status   = Convert.ToInt32(sdr.GetValue(0));
                    assignId = sdr.GetValue(1).ToString();
                }

                if (status != 5)
                {
                    if (BookingNo.Length == 1 || BookingNo.Length == 3)
                    {
                        if (BookingNo.Length == 1)
                        {
                            dsMain = BAL.BALFactory.Instance.BAL_Sticker.GetBookingDetailsData(BookingNo[0], Globals.BranchID, drpBranch.SelectedItem.Value);
                        }
                        else
                        {
                            dsMain = BAL.BALFactory.Instance.BAL_Sticker.GetBookingDetailsData(BookingNo[0], Globals.BranchID, BookingNo[2]);
                            PrjClass.SetItemInDropDown(drpBranch, BookingNo[2].ToString(), false, false);
                        }
                    }
                    else
                    {
                        lblMsg.Text = "Please enter valid input for search";
                        return;
                    }
                    divInprocess.Visible        = false;
                    divWorkshopIn.Visible       = false;
                    divWorkshopOut.Visible      = false;
                    divRecvFromWorkshop.Visible = false;
                    divMarkForDel.Visible       = false;
                    divReady.Visible            = false;
                    divDelivery.Visible         = false;
                    if (dsMain.Tables[0].Rows.Count > 0)
                    {
                        ViewState["dsViewInvoice"] = null;
                        ViewState["dsViewInvoice"] = dsMain;

                        lblWorkShopName.Text = drpBranch.SelectedItem.Text;
                        lblBookingDate.Text  = dsMain.Tables[0].Rows[0]["BookingDate"].ToString();
                        lblTotalQty.Text     = dsMain.Tables[0].Rows[0]["Qty"].ToString();
                        _OrderNo             = dsMain.Tables[0].Rows[0]["BookingNumber"].ToString();
                        lblBookDate.Text     = dsMain.Tables[0].Rows[0]["BookingDate"].ToString();
                        lblDelDate.Text      = dsMain.Tables[0].Rows[0]["BookingDeliveryDate"].ToString();
                        _HomeDelivery        = dsMain.Tables[0].Rows[0]["HomeDelivery"].ToString();
                        if (_HomeDelivery == "True")
                        {
                            HomeDelYes.Visible = true;
                            HomeDelNo.Visible  = false;
                        }
                        else
                        {
                            HomeDelNo.Visible  = true;
                            HomeDelYes.Visible = false;
                        }
                        lblDeliverDate.Text = dsMain.Tables[0].Rows[0]["ClothDeliverDate"].ToString();
                        DateTime dtDue = Convert.ToDateTime(lblDelDate.Text);

                        if (lblDeliverDate.Text != "")
                        {
                            DateTime dtDel = Convert.ToDateTime(lblDeliverDate.Text);
                            if (dtDel >= dtDue)
                            {
                                lblDeliverDate.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                lblDeliverDate.ForeColor = System.Drawing.Color.Black;
                            }
                        }
                        else
                        {
                            lblDeliverDate.ForeColor = System.Drawing.Color.Black;
                        }
                        _WorkShopNote = dsMain.Tables[0].Rows[0]["WorkShopNote"].ToString();
                        _OrderNote    = dsMain.Tables[0].Rows[0]["BookingRemarks"].ToString();

                        lblCustDetail.Text = dsMain.Tables[0].Rows[0]["Customer"].ToString();
                        _custAddress       = dsMain.Tables[0].Rows[0]["CustomerAddress"].ToString();
                        _custPhone         = dsMain.Tables[0].Rows[0]["CustomerPhone"].ToString();
                        _custMob           = dsMain.Tables[0].Rows[0]["CustomerMobile"].ToString();
                        _custEmail         = dsMain.Tables[0].Rows[0]["CustomerEmailId"].ToString();

                        lblPendingAmt.Text   = dsMain.Tables[10].Rows[0]["balance"].ToString();
                        lblPendingCloth.Text = dsMain.Tables[10].Rows[0]["BalQty"].ToString();


                        _GrossAmt    = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["TotalCost"].ToString()), 2));
                        _Discount    = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["DiscountOnPayment"].ToString()), 2));
                        _Tax         = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["ST"].ToString()), 2));
                        _NetAmount   = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["NetAmount"].ToString()), 2));
                        _Advance     = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["PaymentMade"].ToString()), 2));
                        _paid        = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["Paid"].ToString()), 2));
                        _DelDiscount = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["DeliveryDiscount"].ToString()), 2));
                        _Balance     = string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["DuePayment"].ToString()), 2));
                        if (Convert.ToDouble(dsMain.Tables[7].Rows[0]["DiscountOnPayment"]) > 0)
                        {
                            if ((dsMain.Tables[7].Rows[0]["DiscountOption"].ToString()) == "0")
                            {
                                lblDiscountOption.Text = "(" + string.Format("{0:0.00}", Math.Round(Convert.ToDouble(dsMain.Tables[7].Rows[0]["Discount"].ToString()), 2)) + "%)";
                            }
                            else
                            {
                                lblDiscountOption.Text = "";
                            }
                        }
                        grdPayment.DataSource = dsMain.Tables[8];
                        grdPayment.DataBind();

                        int TotPcsMove = 0;
                        TotPcsMove = dsMain.Tables[1].Rows.Count + dsMain.Tables[2].Rows.Count + dsMain.Tables[3].Rows.Count + dsMain.Tables[4].Rows.Count + dsMain.Tables[5].Rows.Count + dsMain.Tables[6].Rows.Count;

                        int OrderPcs = (Convert.ToInt32(dsMain.Tables[0].Rows[0]["Qty"]) - TotPcsMove);

                        lblInProcQty.Text     = Convert.ToString(OrderPcs);
                        lblInProcessDate.Text = dsMain.Tables[0].Rows[0]["BookingDate"].ToString();
                        divInprocess.Visible  = true;



                        if (dsMain.Tables[1].Rows.Count > 0)
                        {
                            lblWorkshopQty.Text   = dsMain.Tables[1].Rows.Count.ToString();
                            lblWorkshopDate.Text  = dsMain.Tables[1].Rows[0]["LastDate"].ToString();
                            divInprocess.Visible  = true;
                            divWorkshopIn.Visible = true;
                        }
                        else
                        {
                            lblWorkshopQty.Text  = dsMain.Tables[1].Rows.Count.ToString();
                            lblWorkshopDate.Text = dsMain.Tables[9].Rows[0]["MaxDate20"].ToString();
                        }

                        if (dsMain.Tables[2].Rows.Count > 0)
                        {
                            lblWorkshopOutQty.Text  = dsMain.Tables[2].Rows.Count.ToString();
                            lblWorkshopOutDate.Text = dsMain.Tables[2].Rows[0]["LastDate"].ToString();

                            divInprocess.Visible   = true;
                            divWorkshopIn.Visible  = true;
                            divWorkshopOut.Visible = true;
                        }
                        else
                        {
                            lblWorkshopOutQty.Text  = dsMain.Tables[2].Rows.Count.ToString();
                            lblWorkshopOutDate.Text = dsMain.Tables[9].Rows[0]["MaxDate30"].ToString();
                        }


                        if (dsMain.Tables[3].Rows.Count > 0)
                        {
                            lblRecvFromWorkshopQty.Text  = dsMain.Tables[3].Rows.Count.ToString();
                            lblRecvFromWorkshopDate.Text = dsMain.Tables[3].Rows[0]["LastDate"].ToString();

                            divInprocess.Visible        = true;
                            divWorkshopIn.Visible       = true;
                            divWorkshopOut.Visible      = true;
                            divRecvFromWorkshop.Visible = true;
                        }
                        else
                        {
                            lblRecvFromWorkshopQty.Text  = dsMain.Tables[3].Rows.Count.ToString();
                            lblRecvFromWorkshopDate.Text = dsMain.Tables[9].Rows[0]["MaxDate2"].ToString();
                        }


                        if (dsMain.Tables[4].Rows.Count > 0)
                        {
                            lblMarkForDelQty.Text  = dsMain.Tables[4].Rows.Count.ToString();
                            lblMarkForDelDate.Text = dsMain.Tables[4].Rows[0]["LastDate"].ToString();


                            divInprocess.Visible        = true;
                            divWorkshopIn.Visible       = true;
                            divWorkshopOut.Visible      = true;
                            divRecvFromWorkshop.Visible = true;
                            divMarkForDel.Visible       = true;
                        }
                        else
                        {
                            lblMarkForDelQty.Text  = dsMain.Tables[4].Rows.Count.ToString();
                            lblMarkForDelDate.Text = dsMain.Tables[9].Rows[0]["MaxDate50"].ToString();
                        }
                        if (dsMain.Tables[5].Rows.Count > 0)
                        {
                            lblReadyQty.Text  = dsMain.Tables[5].Rows.Count.ToString();
                            lblReadyDate.Text = dsMain.Tables[5].Rows[0]["LastDate"].ToString();

                            divInprocess.Visible        = true;
                            divWorkshopIn.Visible       = true;
                            divWorkshopOut.Visible      = true;
                            divRecvFromWorkshop.Visible = true;
                            divMarkForDel.Visible       = true;
                            divReady.Visible            = true;
                        }
                        else
                        {
                            lblReadyQty.Text  = dsMain.Tables[5].Rows.Count.ToString();
                            lblReadyDate.Text = dsMain.Tables[9].Rows[0]["MaxDate3"].ToString();
                        }

                        if (dsMain.Tables[6].Rows.Count > 0)
                        {
                            lblDeliveryQty.Text  = dsMain.Tables[6].Rows.Count.ToString();
                            hdnDeliveryQty.Value = dsMain.Tables[6].Rows.Count.ToString();
                            lblDeliveryDate.Text = dsMain.Tables[6].Rows[0]["LastDate"].ToString();

                            divInprocess.Visible        = true;
                            divWorkshopIn.Visible       = true;
                            divWorkshopOut.Visible      = true;
                            divMarkForDel.Visible       = true;
                            divRecvFromWorkshop.Visible = true;
                            divReady.Visible            = true;
                            divDelivery.Visible         = true;
                        }
                        divInvoiceDetail.Visible = true;
                        applyCSS();
                        if (BookingNo.Length == 3)
                        {
                            BindNullGrid(grdInvoice);
                            grdInvoice.DataSource = dsMain.Tables[0];
                            grdInvoice.DataBind();
                            IsBarcode = true;
                            FindGridRowForHighLighted(grdInvoice, txtBarcode.Text);
                        }
                        statusVisible();
                    }
                    else
                    {
                        divInvoiceDetail.Visible = false;
                        lblMsg.Text = "No Record Found.";
                    }
                    txtBarcode.Text = "";
                    txtBarcode.Focus();
                }
                else
                {
                    lblMsg.Text = "This booking number  is cancelled";
                }
            }
            catch (Exception ex)
            {
                lblMsg.Text = ex.ToString();
            }
            finally
            {
                sdr.Close();
                sdr.Dispose();
                cmd.Dispose();
            }
        }
Exemplo n.º 19
0
        protected void grdEntry_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblId.Text    = ((Label)grdEntry.SelectedRow.FindControl("lblPackageId")).Text;
            txtTitle.Text = grdEntry.SelectedRow.Cells[3].Text == "&nbsp;" ? "" : grdEntry.SelectedRow.Cells[3].Text;
            txtCost.Text  = grdEntry.SelectedRow.Cells[4].Text == "&nbsp;" ? "" : grdEntry.SelectedRow.Cells[4].Text;
            PrjClass.SetItemInDropDown(drpPackageType, grdEntry.SelectedRow.Cells[2].Text, true, false);
            string BenefitType = string.Empty, Active = string.Empty;

            BenefitType           = ((Label)grdEntry.SelectedRow.FindControl("lblBenefitType")).Text;
            lblDuplicateItem.Text = grdEntry.SelectedRow.Cells[3].Text == "&nbsp;" ? "" : grdEntry.SelectedRow.Cells[3].Text;
            Active = grdEntry.SelectedRow.Cells[7].Text == "&nbsp;" ? "" : grdEntry.SelectedRow.Cells[7].Text;
            PrjClass.SetItemInDropDown(drpServiceTaxType, ((Label)grdEntry.SelectedRow.FindControl("lblTaxType")).Text, true, false);
            if (BenefitType == "Amount")
            {
                // rdbAmount.Checked = true;
                //  rdbDiscount.Checked = false;
                txtAmount.Text      = ((Label)grdEntry.SelectedRow.FindControl("lblBenefitValue")).Text;
                txtAmount.Enabled   = true;
                txtDiscount.Enabled = false;
                txtDiscount.Text    = "0";
            }
            else
            {
                //  rdbDiscount.Checked = true;
                // rdbAmount.Checked = false;
                txtDiscount.Text    = ((Label)grdEntry.SelectedRow.FindControl("lblBenefitValue")).Text;
                txtDiscount.Enabled = true;
                txtAmount.Enabled   = false;
                txtAmount.Text      = "0";
            }
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "testCustom(" + drpPackageType.ClientID + ");", true);
            if (grdEntry.SelectedRow.Cells[2].Text == "Qty / Item" || grdEntry.SelectedRow.Cells[2].Text == "Flat Qty")
            {
                DataSet   ds = new DataSet();
                DataTable dt = new DataTable();
                ds = BAL.BALFactory.Instance.BL_PackageMaster.GetPackageQtyDetail(lblId.Text, Globals.BranchID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    dt = ds.Tables[0];
                    grdBind.DataSource = dt;
                    grdBind.DataBind();
                    ((Label)grdBind.FooterRow.Cells[0].FindControl("lblNewSno")).Text = GetNewSNo().ToString();
                    ViewState["VSEntryTable"] = dt;
                    txtFlatQty.Text           = ((Label)grdEntry.SelectedRow.FindControl("lblTotalQty")).Text;
                }
                else
                {
                    SetGridForEntryWhenNoDataIsPresent();
                    txtFlatQty.Text = ((Label)grdEntry.SelectedRow.FindControl("lblTotalQty")).Text;
                }
                txtRecurrence.Text         = ((Label)grdEntry.SelectedRow.FindControl("lblRecurrence")).Text;
                txtStartDate.Text          = ((Label)grdEntry.SelectedRow.FindControl("lblStartDate")).Text;
                txtEndDate.Text            = ((Label)grdEntry.SelectedRow.FindControl("lblEndDate")).Text;
                hdnIsRecurrenceValid.Value = "true";
            }
            else
            {
                SetGridForEntryWhenNoDataIsPresent();
                txtStartDate.Text = ((Label)grdEntry.SelectedRow.FindControl("lblStartDate")).Text;
                txtEndDate.Text   = ((Label)grdEntry.SelectedRow.FindControl("lblEndDate")).Text;
            }
            txtTitle.Focus();
            txtTitle.Attributes.Add("onfocus", "javascript:select();");
            btnSave.Visible   = false;
            btnUpdate.Visible = true;
            btnDelete.Visible = true;
            Ob.PackageId      = lblId.Text;
            Ob.BranchId       = Globals.BranchID;
            if (BenefitType == "Amount")
            {
                txtAmount.Enabled   = true;
                txtDiscount.Enabled = false;
            }
            else
            {
                txtDiscount.Enabled = true;
                txtAmount.Enabled   = false;
            }
            if (BAL.BALFactory.Instance.BL_PackageMaster.CheckPackageInAssignTable(Ob) == true)
            {
                btnSave.Visible     = false;
                btnUpdate.Visible   = false;
                btnDelete.Visible   = false;
                txtTitle.Enabled    = false;
                txtCost.Enabled     = false;
                txtAmount.Enabled   = false;
                txtDiscount.Enabled = false;
                SetTextBox(false);
                grdBind.FooterRow.Visible = false;
                txtFlatQty.Enabled        = false;
            }
            else
            {
                txtTitle.Enabled    = true;
                txtCost.Enabled     = true;
                txtAmount.Enabled   = true;
                txtDiscount.Enabled = true;
                SetTextBox(true);
                grdBind.FooterRow.Visible = true;
                txtFlatQty.Enabled        = true;
            }
        }