コード例 #1
0
ファイル: ChequeVoid.ascx.cs プロジェクト: mehedi09/GridWork
    public static string CreateVoid(string serialno)
    {
        MyCompany.Rules.SharedBusinessRules ad = new MyCompany.Rules.SharedBusinessRules();
        int accfund = 3;
        if (!string.IsNullOrEmpty(ad.CompanyID.ToString()))
        {
            accfund = int.Parse(ad.CompanyID.ToString());
        }
        string result = string.Empty;
        string conr = System.Configuration.ConfigurationManager.ConnectionStrings["MyCompany"].ConnectionString;
        string sql = string.Empty;
        //int AccfundID = 3;
        DataTable dt = new DataTable();
        SqlConnection con = new SqlConnection(conr);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "USP_ChequeVoid";
        cmd.CommandType = CommandType.StoredProcedure;
        if (string.IsNullOrEmpty(serialno))
        {
            cmd.Parameters.Add(new SqlParameter("@serialno", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@serialno", serialno));
        }

        cmd.Connection = con;
        con.Open();
        int re = cmd.ExecuteNonQuery();
        if (re > 0)
            result = "save";

        return result;
    }
コード例 #2
0
    public static string[] GetChequeLeaf(string keyword, string contextKey)
    {
        MyCompany.Rules.SharedBusinessRules ad = new MyCompany.Rules.SharedBusinessRules();

        int accfund = 3;
        if (!string.IsNullOrEmpty(ad.GetProperty("Session_CompanyID").ToString()))
        {
            accfund = int.Parse(ad.GetProperty("Session_CompanyID").ToString());
        }
        int contextValue = int.Parse(contextKey);
        string sql = "SELECT  (CONVERT(nvarchar, cl.LeafID)+':'+convert(nvarchar, cl.LeafNumber)) as LeafNumber  FROM [dbo].[ChequeBooksLeaf] cl inner join dbo.ChequeBooks cb on cl.ChequeBookID=cb.ChequeBookID " +
                    " where cl.IsUsed=0 and cb.AccFundID=" + accfund + " and cb.CoaDetailID=" + contextKey + " and cl.LeafNumber like @keyword  ";
        // string sql = "Select StyleTrandId  + ':' +  StyleNo as StyleNo from tblStyleInformation where IndependentStyle='false' and StyleNo like @prefixText"; //"select ItemCode, ItemName from tblItemListInfo where ItemName like @prefixText";
        SqlDataAdapter da = new SqlDataAdapter(sql, conr);
        da.SelectCommand.Parameters.Add("@keyword", System.Data.SqlDbType.VarChar, 50).Value = "%" + keyword + "%";
        DataTable DTLocal = new DataTable();
        da.Fill(DTLocal);

        string[] items = new string[DTLocal.Rows.Count];
        int i = 0;
        foreach (DataRow dr in DTLocal.Rows)
        {
            items.SetValue(dr["LeafNumber"].ToString(), i);
            i++;
        }
        return items;
    }
コード例 #3
0
 public override void ProcessPageRequest(PageRequest request, ViewPage page)
 {
     SharedBusinessRules.SetFormatField(page);
 }
コード例 #4
0
 public override void ProcessPageRequest(PageRequest request, ViewPage page)
 {
     Context.Session["UserName"] = SharedBusinessRules.UserName;
     SharedBusinessRules.SetFormatField(page);
 }
コード例 #5
0
ファイル: BillPay.ascx.cs プロジェクト: mehedi09/GridWork
    public static string CreateBill(string serialno, string bank, string chequeno, string chequedate, string leafID)
    {
        MyCompany.Rules.SharedBusinessRules ad = new MyCompany.Rules.SharedBusinessRules();
        int accfund = 3;
        if (!string.IsNullOrEmpty(ad.CompanyID.ToString()))
        {
            accfund = int.Parse(ad.CompanyID.ToString());
        }
        string result = string.Empty;
        string conr = System.Configuration.ConfigurationManager.ConnectionStrings["MyCompany"].ConnectionString;
        string sql = string.Empty;
        //int AccfundID = 3;
        DataTable dt = new DataTable();
        SqlConnection con = new SqlConnection(conr);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "USP_SupplierBIlllPayment";
        cmd.CommandType = CommandType.StoredProcedure;
        if (string.IsNullOrEmpty(serialno))
        {
            cmd.Parameters.Add(new SqlParameter("@serialno", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@serialno", serialno));
        }
        if (string.IsNullOrEmpty(bank))
        {
            cmd.Parameters.Add(new SqlParameter("@CoaDetailID", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@CoaDetailID", int.Parse(bank)));
        }

        if (string.IsNullOrEmpty(chequeno))
        {
            cmd.Parameters.Add(new SqlParameter("@chequeno", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@chequeno", chequeno));
        }

        if (string.IsNullOrEmpty(chequedate))
        {
            cmd.Parameters.Add(new SqlParameter("@chequedate", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@chequedate", chequedate));
        }
        if (string.IsNullOrEmpty(accfund.ToString()))
        {
            cmd.Parameters.Add(new SqlParameter("@AccFundID", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@AccFundID", accfund));
        }
        if (string.IsNullOrEmpty(leafID))
        {
            cmd.Parameters.Add(new SqlParameter("@LeafID", DBNull.Value));
        }
        else
        {
            cmd.Parameters.Add(new SqlParameter("@LeafID",int.Parse( leafID)));
        }

        cmd.Connection = con;
        con.Open();
          int re=  cmd.ExecuteNonQuery();
        if( re>0)
        result = "save";

        return result;
    }
コード例 #6
0
        public virtual void AccessControlValidation()
        {
            if (Context.User.Identity.IsAuthenticated)
            {
                SharedBusinessRules shareduser = new SharedBusinessRules();
                shareduser.SessionInput(Context.User.Identity.Name);
                return;
            }

            if (!((((Request.View == "signUpForm") || (Request.View == "passwordRequestForm")) || (Request.View == "identityConfirmationForm"))))
                throw new Exception("Not authorized");
        }