Exemplo n.º 1
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    static public void InsertError(string errorPage, string errorFunction)
    {
        string userID   = ((string)HttpContext.Current.Session["UserName"]);
        string userRole = Convert.ToString(HttpContext.Current.Session["Role"]);
        //string errorPage = "EmployeMaster.aspx";
        //string errorFunction = "btnSaveInsert";
        DateTime      dt         = DateTime.Now;
        StringBuilder errorQuery = new StringBuilder();

        errorQuery.Append("INSERT INTO [ErrorLog]([ErrorPage],[ErrorFunction],[ErrorDate] ,[LoginUserID],[LoginUserRole]) VALUES ('" + errorPage + "','" + errorFunction + "'");
        errorQuery.Append(",'" + DateFun.HijToGrn(DateFun.GrnToHij(dt)) + "','" + userID + "','" + userRole + "')");

        Int32 returnValue = ExecuteData(errorQuery.ToString());
    }
Exemplo n.º 2
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public string SelectDateFormat(string pDateType, string pDate)
    {
        //DateTime Date = Convert.ToDateTime(pDate);
        string strValue = "";

        if (pDateType == "Gregorian")
        {
            strValue = DateFun.strTodt(String.Format("{0:dd/MM/yyyy}", pDate)).ToShortDateString();
        }
        else if (pDateType == "Hijri")
        {
            strValue = DateFun.HijToGrn(pDate).ToShortDateString();
        }

        return(strValue);
    }