Esempio n. 1
0
 protected void gvBranchSetup_OnRowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         var lblopertionstartdate = e.Row.FindControl("lblopertionstartdate") as Label;
         lblopertionstartdate.Text = ConvertNE.ConvertEToNWithSlash(DateTime.Parse(lblopertionstartdate.Text));
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         var dt = GetClosedDate();
         if (dt != DateTime.Parse("1/1/0001"))
         {
             lbltextclosed.Text = "Day Closed Till";
             lblclosedate.Text  = ConvertNE.ConvertEToNWithSlash(dt);
         }
         else
         {
             lbltextclosed.Text = "Day Not Closed Yet";
             lblclosedate.Text  = "";
         }
     }
 }
        //public static string (string stringToEncrypt)// Encrypt the content
        //{
        //    byte[] key;
        //    byte[] IV;

        //    byte[] inputByteArray;
        //    try
        //    {
        //        key = Convert2ByteArray(DESKey);
        //        IV = Convert2ByteArray(DESIV);
        //        inputByteArray = Encoding.UTF8.GetBytes(stringToEncrypt);
        //        DESCryptoServiceProvider des = new DESCryptoServiceProvider();
        //        MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(key, IV), CryptoStreamMode.Write);
        //        cs.Write(inputByteArray, 0, inputByteArray.Length);
        //        cs.FlushFinalBlock();
        //        return Convert.ToBase64String(ms.ToArray());
        //    }
        //    catch (System.Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //static byte[] Convert2ByteArray(string strInput)
        //{
        //    int intCounter; char[] arrChar;
        //    arrChar = strInput.ToCharArray();
        //    byte[] arrByte = new byte[arrChar.Length];
        //    for (intCounter = 0; intCounter <= arrByte.Length - 1; intCounter++)
        //        arrByte[intCounter] = Convert.ToByte(arrChar[intCounter]);
        //    return arrByte;
        //}



        private void GetCompanyInfo(string CompanyCode)
        {
            DataTable dt = BL_CompanyInfoDrose.GetCompanyInfo(1, "", CompanyCode, System.DateTime.Now);

            if (dt.Rows.Count > 0)
            {
                txtCompanyName.Text       = dt.Rows[0]["CompanyName"].ToString();
                txtRegistrationNo.Text    = "";
                txtRegistrationNo.Enabled = false;
                txtPanNo.Text             = (dt.Rows[0]["PanNo"].ToString());
                txtCountry.Text           = (dt.Rows[0]["Country"].ToString());
                txtState.Text             = (dt.Rows[0]["State"].ToString());
                txtCity.Text        = (dt.Rows[0]["City"].ToString());
                txtAddress1.Text    = (dt.Rows[0]["Adress1"].ToString());
                txtAddress2.Text    = (dt.Rows[0]["Adress2"].ToString());
                txtTelephoneNo.Text = (dt.Rows[0]["TelephoneNo"].ToString());
                // (dt.Rows[0]["Logo"].ToString());
                txtEmailAddress.Text = (dt.Rows[0]["EmailAdress"].ToString());
                txtWebAddress.Text   = (dt.Rows[0]["WebAdress"].ToString());
                //(dt.Rows[0]["C1"].ToString());
                //(dt.Rows[0]["C2"].ToString());
                //  (dt.Rows[0]["MC"].ToString());
                txtDate.Text = ConvertNE.ConvertEToNWithSlash(Convert.ToDateTime((dt.Rows[0]["Created_Date"].ToString())));
                btn_insert.CommandArgument = dt.Rows[0]["COMPANY_CODE"].ToString();
                // (dt.Rows[0]["DATABASE_NAME"].ToString());
                txtUserName.Text = (dt.Rows[0]["ADMIN_USER_NAME"].ToString());
                //(dt.Rows[0]["PWD"].ToString());
                txtImagesDrive.Text = dt.Rows[0]["IMAGES_DRIVE"].ToString();

                txtContactPersonName.Text = dt.Rows[0]["CONTACT_PERSON_NAME"].ToString();
                txtTelNo.Text             = dt.Rows[0]["C_TEL_NO"].ToString();
                txtMobNo.Text             = dt.Rows[0]["MOB_NO"].ToString();
                txtContactAddress.Text    = dt.Rows[0]["C_ADDRESS"].ToString();
                txtEmailAdd.Text          = dt.Rows[0]["EMAIL_ADDRESS"].ToString();
                txtNostroAcNCB.Text       = dt.Rows[0]["NOSTRO_AC_NCB"].ToString();
                txtMirrorNCB.Text         = dt.Rows[0]["MIRROR_AC_NCB"].ToString();
                txtMirrorNCB.Text         = dt.Rows[0]["MIRROR_AC_DROSE"].ToString();


                btn_insert.Text        = "Update";
                btn_insert.CommandName = "Update";
            }
        }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             var nepdate = (ConvertNE.ConvertEToNWithSlash(DateTime.Today));
             //lblnepdate.InnerText = nepdate;
             //lblopdateeng.InnerText = DateTime.Today.Date.ToString("yyyy /MM/ dd") + "      ||";
             flyout_menu1.InnerHtml = FillMenu();
             //lblWelcome.Text = BK_Session.GetSession().UserName.ToString();
             Page.Header.DataBind();
             CheckMenuRights();
         }
     }
     catch
     {
         Response.Redirect("~/Login.aspx");
     }
 }
Esempio n. 5
0
    /**
     * Calculates wheather english year is leap year or not
     *
     * @param integer $year
     * @return boolean
     */
    public static string GetDefaultYearMonthDays(string yearMonthDays)
    {
        string nepdate = ConvertNE.ConvertEToNWithSlash(BK_Session.GetSession().OpDate);

        string[] nepdatearray = nepdate.Split('/');
        string   year         = nepdatearray[0].ToString();
        string   month        = nepdatearray[1].ToString();
        string   days         = nepdatearray[2].ToString();

        if (yearMonthDays.ToLower() == "year")
        {
            if (Convert.ToInt16(month) >= 4)
            {
            }
            else
            {
                year = (Convert.ToInt16(year) - 1).ToString();
            }
            return(year);
        }
        else if (yearMonthDays.ToLower() == "month")
        {
            return(month);
        }
        else if (yearMonthDays.ToLower() == "days")
        {
            return(days);
        }
        else if (yearMonthDays.ToLower() == "nepDate")
        {
            return(nepdate);
        }
        else
        {
            return(nepdate);
        }
    }