コード例 #1
0
        public DataTable Get_GST_DC_TotAmt_onID(int ID)
        {
            DataTable table = null;

            try
            {
                // get a configured DbCommand object
                DbCommand comm = DBLayer.CreateCommand();

                // set the stored procedure name
                comm.CommandText = "USP_GetDCTotAmtonID";

                DbParameter param = comm.CreateParameter();
                param.ParameterName = "@ID";
                param.Value         = ID;
                param.DbType        = DbType.Int32;
                comm.Parameters.Add(param);

                // execute the stored procedure and save the results in a DataTable
                table = DBLayer.ExecuteSelectCommand(comm);
                return(table);
            }
            finally
            {
                table.Dispose();
            }
        }
コード例 #2
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        //get cust state
        public static DataTable get_cust_state(int id)
        {
            SqlCommand cmd = new SqlCommand("select s.Name from Users.Customers c, Users.User_state s where c.state = s.Id and c.id =@id ");

            cmd.Parameters.AddWithValue("@id", id);
            return(DBLayer.select(cmd));
        }
コード例 #3
0
        public static DataTable get_reversecharges(int supplerid)
        {
            DataTable table = null;

            try
            {
                // get a configured DbCommand object
                DbCommand comm = DBLayer.CreateCommand();
                // set the stored procedure name
                comm.CommandText = "getting_Reversecharges";


                // create a new parameter
                DbParameter param = comm.CreateParameter();
                param.ParameterName = "@Supplier_Id";
                param.Value         = supplerid;
                param.DbType        = DbType.Int32;
                comm.Parameters.Add(param);



                // execute the stored procedure and save the results in a DataTable
                table = DBLayer.ExecuteSelectCommand(comm);
                return(table);
            }
            finally
            {
                table.Dispose();
            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["CurrentUser"] == null)
         {
             Response.Redirect("Login.aspx");
         }
         if (CurrentPage != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetPageContent(CurrentPage);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
                 uiFCKeditorContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());
             }
             uiPanelCurrentPages.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             Response.Redirect("AdminCP.aspx");
         }
     }
 }
コード例 #5
0
 private void BindData()
 {
     DBLayer db = new DBLayer();
     if (!string.IsNullOrEmpty(uiDropDownListCats.SelectedValue))
         uiDataListPhotos.DataSource = db.GetAllProductByCatID(Convert.ToInt32(uiDropDownListCats.SelectedValue));
     uiDataListPhotos.DataBind();
 }
コード例 #6
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        // procerss
        public static DataTable getpassword(int id)
        {
            SqlCommand cmd = new SqlCommand("select u.password from Users.Users u , Users.Customers c where u.Id = c.userid and  c.Id=@id ");

            cmd.Parameters.AddWithValue("@id", id);
            return(DBLayer.select(cmd));
        }
コード例 #7
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        //serch by name
        public static DataTable getByName(string name)
        {
            SqlCommand cmd = new SqlCommand("select *  from users.Customers where firts_name=@name");

            cmd.Parameters.AddWithValue("@name", name);
            return(DBLayer.select(cmd));
        }
コード例 #8
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        //serch by id
        public static DataTable getById(int id)
        {
            SqlCommand cmd = new SqlCommand("select *  from users.Customers where id=@id");

            cmd.Parameters.AddWithValue("@id", id);
            return(DBLayer.select(cmd));
        }
コード例 #9
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        // udpdate state from customre

        public static int ChangeCustState(int id)
        {
            SqlCommand cmd = new SqlCommand("update Users.Customers  set state =1 where id =@id");

            cmd.Parameters.AddWithValue("@id", id);
            return(DBLayer.dml(cmd));
        }
コード例 #10
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        //
        public static int add(string username, string fname, string lname, string email, string id_image, string location, string delivery_address, string password)
        {
            //check for userName unique
            SqlCommand cmd = new SqlCommand("insert into Users.Users values(@username,@password,1)");

            cmd.Parameters.AddWithValue("@username", username);
            cmd.Parameters.AddWithValue("@password", password);
            if (DBLayer.dml(cmd) == 1)
            { //get id
                SqlCommand cmdGetId = new SqlCommand("select id from Users.Users where user_name=@username");
                cmdGetId.Parameters.AddWithValue("@username", username);
                DataTable result  = DBLayer.select(cmdGetId);
                int       user_id = int.Parse(result.Rows[0]["id"].ToString());

                // 1 for user state deactive
                SqlCommand cmdInserToCust = new SqlCommand("insert into Users.Customers values(@userid,@fname,@lname,@email,@idimage,@location,@delivery,1)");
                cmdInserToCust.Parameters.AddWithValue("@userid", user_id);
                cmdInserToCust.Parameters.AddWithValue("@fname", fname);
                cmdInserToCust.Parameters.AddWithValue("@lname", lname);
                cmdInserToCust.Parameters.AddWithValue("@email", email);

                cmdInserToCust.Parameters.AddWithValue("@idimage", id_image);
                cmdInserToCust.Parameters.AddWithValue("@location", location);
                cmdInserToCust.Parameters.AddWithValue("@delivery", delivery_address);

                return(DBLayer.dml(cmdInserToCust));
            }
            else
            {
                throw new Exception("user name is token try diff one ");
                // return -1
            }
        }
コード例 #11
0
 public int UpdateFields(int fieldId)
 {
     int successStatusCode = 0;
     DBLayer dbLayerUpdateFieldTable = new DBLayer();
     successStatusCode = dbLayerUpdateFieldTable.GetUpdateFieldTable(fieldId);
     return successStatusCode;
 }
コード例 #12
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        // get delivery address
        public static DataTable get_cust_delivery_address(int id)
        {
            SqlCommand cmd = new SqlCommand("select delivery_address from users.Customers where id=@id");

            cmd.Parameters.AddWithValue("@id", id);
            return(DBLayer.select(cmd));
        }
コード例 #13
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        //get  id  from user id
        public static DataTable get_id(int userid)
        {
            SqlCommand cmd = new SqlCommand("select  id from Users.Customers where userid = @userid");

            cmd.Parameters.AddWithValue("@userid", userid);
            return(DBLayer.select(cmd));
        }
コード例 #14
0
ファイル: identity.cs プロジェクト: rawda95/OnlineShop
        public static int last_add_item()
        {
            SqlCommand cmd  = new SqlCommand("select SCOPE_IDENTITY()");
            DataTable  temp = DBLayer.select(cmd);

            return(int.Parse(temp.Rows[0][0].ToString()));
        }
コード例 #15
0
        public void ShowGames()
        {
            DataTable dtable = new DataTable();

            dtable = DBLayer.RefreshTable(@"SELECT GameID,GameName as'اسم التدريب' FROM Games");
            dataGridView1.DataSource = dtable;
        }
コード例 #16
0
        public static DataTable get_seller_order_state(int seller_id)
        {
            SqlCommand cmd = new SqlCommand("select * from[Orders].[Order_Status] oo, [Orders].[Order] o where oo.id = o.order_status and o.cust_id = @seller_id");

            cmd.Parameters.AddWithValue("seller_id", seller_id);
            return(DBLayer.select(cmd));
        }
コード例 #17
0
 protected void uiGridViewNews_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Editmails")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentMail = id;
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetNewsContent(id);
         if (ds.Tables[0].Rows.Count > 0)
         {
             uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Email"].ToString();
             uiTextBoxPosition.Text = ds.Tables[0].Rows[0]["Position"].ToString();
         }
         uiPanelCurrentNews.Visible = false;
         uiPanelCurrent.Visible = true;
     }
     else if (e.CommandName == "Deletemails")
     {
         DBLayer db = new DBLayer();
         db.DeleteBookingMails(Convert.ToInt32(e.CommandArgument.ToString()));
         BindData();
         uiPanelCurrentNews.Visible = true;
         uiPanelCurrent.Visible = false;
     }
 }
コード例 #18
0
        public static DataTable get_order(int order_id)
        {
            SqlCommand cmd = new SqlCommand("select * from  [Orders].[Order] where id=@id");

            cmd.Parameters.AddWithValue("@id", order_id);
            return(DBLayer.select(cmd));
        }
コード例 #19
0
        public static DataTable get_customer_orders(int cust_id)
        {
            SqlCommand cmd = new SqlCommand("select o.id, s.name order_status, order_date from[Orders].[Order] o,[Orders].[Order_Status] s where cust_id = @cust_id and o.order_status = s.id");

            cmd.Parameters.AddWithValue("@cust_id", cust_id);
            return(DBLayer.select(cmd));
        }
コード例 #20
0
        public static DataTable get_Shop_orders(int shop_id)
        {
            SqlCommand cmd = new SqlCommand("select o.* from [Orders].[Order] o , Orders.Order_Products op ,Shop.stock s where o.id = op.order_id and op.Product_id = s.product_id and  and shop_id = @shop_id");

            cmd.Parameters.AddWithValue("@shop_id", shop_id);
            return(DBLayer.select(cmd));
        }
コード例 #21
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        // get id by email for reset password
        public static DataTable getByEmail(string email)
        {
            SqlCommand cmd = new SqlCommand("select id  from users.Customers where email=@email");

            cmd.Parameters.AddWithValue("@email", email);
            return(DBLayer.select(cmd));
        }
コード例 #22
0
ファイル: GetTermUse.aspx.cs プロジェクト: amuss2003/Pulsar
        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer dblayer = new DBLayer();

            dblayer.CreateConnectionString(Server.MapPath("."));

            String LoginKey          = Request["LoginKey"];
            String CMailBoxInstallID = Request["CMailBoxInstallID"];

            if ((LoginKey != null) && (LoginKey == "xezp3avnniqyjf45wso0ot45"))
            {
                if ((CMailBoxInstallID != null) && (CMailBoxInstallID != ""))
                {
                    CMailBox cMailBox = dblayer.GetCMailBox(CMailBoxInstallID);
                    Response.Write(dblayer.ErrorList);
                    if (cMailBox != null)
                    {
                        Response.Write(cMailBox.CommercialUse ? "OK" : "Cancel");
                    }
                    else
                    {
                        Response.Write("Cancel");
                    }
                }
            }
        }
コード例 #23
0
        protected void uiGridViewContacts_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditContact")
            {
                DBLayer db = new DBLayer();
                CurrentContact = Convert.ToInt32(e.CommandArgument);
                DataSet ds = db.GetContactContent(CurrentContact);
                uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
                uiTextBoxLatitude.Text = ds.Tables[0].Rows[0]["Latitude"].ToString();
                uiTextBoxLongitude.Text = ds.Tables[0].Rows[0]["Longitude"].ToString();
                uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
                uiTextBoxMail.Text = ds.Tables[0].Rows[0]["email"].ToString();
                uiPanelViewContact.Visible = false;
                uiPanelEdit.Visible = true;

            }
            else if (e.CommandName == "DeleteContact")
            {
                DBLayer db = new DBLayer();
                db.DeleteContact(Convert.ToInt32(e.CommandArgument));
                CurrentContact = 0;
                BindData();

            }
        }
コード例 #24
0
        public int INSERT_SO_Details_Modified_Rejected_SO_Details(DataTable SalesSum, DataTable SalesDet, String ADID, DataTable SalesTax, string BillingAddress, string ShippingAddress, string TermsOfDelivery, string SONum)
        {
            int        Result;
            SqlCommand command = DBLayer.CreateSqlCommand();

            command.CommandText = "USP_INSERT_SO_Details_Modified_Rejected_SO_Details";
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@Salse_Summary", SalesSum);

            command.Parameters["@Salse_Summary"].TypeName = "Salse_Summary";

            command.Parameters.AddWithValue("@Sales_Details", SalesDet);

            command.Parameters["@Sales_Details"].TypeName = "Sales_Details_New";

            command.Parameters.AddWithValue("@IDListString", ADID);

            command.Parameters.AddWithValue("@Sales_Tax", SalesTax);

            command.Parameters["@Sales_Tax"].TypeName = "Sales_Tax";

            command.Parameters.AddWithValue("@BillingAddress", BillingAddress);
            command.Parameters.AddWithValue("@ShippingAddress", ShippingAddress);
            command.Parameters.AddWithValue("@TermsOfDelivery", TermsOfDelivery);
            command.Parameters.AddWithValue("@SO_Number", SONum);
            Result = DBLayer.ExecuteNonQuery(command);
            return(Result);
        }
コード例 #25
0
 protected void uiGridViewBlocks_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditBlock")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentBlock = id;
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetBlockContent(id);
         if (ds.Tables[0].Rows.Count > 0)
         {
             uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
             uiFCKeditor.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["Brief"].ToString());
             if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Imagepath"].ToString()))
             {
                 uiImageCurrent.ImageUrl = ds.Tables[0].Rows[0]["Imagepath"].ToString();
                 uiImageCurrent.Visible = true;
             }
             else
             {
                 uiImageCurrent.Visible = false;
             }
         }
         uiPanelCurrentBlocks.Visible = false;
         uiPanelCurrent.Visible = true;
     }
 }
コード例 #26
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            DBLayer connectLayer = new DBLayer();

            dgChanges.DataContext = null;
            dgChanges.DataContext = connectLayer.updateRows();
        }
コード例 #27
0
        public static DataTable getCustomerOrders(int customer_id)
        {
            SqlCommand cmd = new SqlCommand("select * from  [Orders].Order where cust_id= @customer_id");

            cmd.Parameters.AddWithValue("@customer_id", customer_id);
            return(DBLayer.select(cmd));
        }
コード例 #28
0
ファイル: customer.cs プロジェクト: rawda95/OnlineShop
        //serch by location
        public static DataTable getByLocation(string location)
        {
            SqlCommand cmd = new SqlCommand("select *  from users.Customers where location like '%@location%'");

            cmd.Parameters.AddWithValue("@location", location);
            return(DBLayer.select(cmd));
        }
コード例 #29
0
 protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditCat")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentCat = id;
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetCategoryContent(id);
         if (ds.Tables[0].Rows.Count > 0)
         {
             uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["CategoryName"].ToString();
             uiTextBoxArTitle.Text = ds.Tables[0].Rows[0]["CategoryArName"].ToString();
         }
         uiPanelCurrentPages.Visible = false;
         uiPanelCurrent.Visible = true;
     }
     else if (e.CommandName == "DeleteCat")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentCat = id;
         DBLayer db = new DBLayer();
         db.DeleteCategory(id);
         BindData();
     }
 }
コード例 #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["SID"] != null && !string.IsNullOrEmpty(Request.QueryString["SID"]))
         {
             uiPanelAllServices.Visible = false;
             uiPanelViewService.Visible = true;
             int id = Convert.ToInt32(Request.QueryString["SID"].ToString());
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetServicesContent(id);
             uiImageService.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString();
             uiLabelTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
             uiLiteralBrief.Text = ds.Tables[0].Rows[0]["arBrief"].ToString();
             uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());
         }
         else
         {
             uiPanelAllServices.Visible = true;
             uiPanelViewService.Visible = false;
             BindData();
         }
     }
     RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m4\").addClass(\"selected\");</script>");
 }
コード例 #31
0
 protected void uiLinkButtonUpdate_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     string imagepath = "";
     if (uiFileUploadImage.HasFile)
     {
         uiFileUploadImage.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName));
         imagepath = ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName;
     }
     // update
     if (CurrentPackage != 0)
     {
         DataSet ds = new DataSet();
         ds = db.GetPackageContent(CurrentPackage);
         string temp = ds.Tables[0].Rows[0]["arImagepath"].ToString();
         if (temp != imagepath && string.IsNullOrEmpty(imagepath))
             db.SetArabicPackageContent(CurrentPackage, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, temp, Convert.ToInt32(uiTextBoxOrder.Text));
         else
             db.SetArabicPackageContent(CurrentPackage, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text));
     }
     else // add new
     {
         db.AddArabicPackageContent(uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text));
     }
     uiPanelViewPackages.Visible = true;
     uiPanelEditPackage.Visible = false;
     ClearFields();
     CurrentPackage = 0;
     BindData();
 }
コード例 #32
0
        public ActionResult CreateAccount(UserView model)
        {
            // this checks the models state
            if (!ModelState.IsValid)
            {
                return(View("CreateAccount", model));
            }

            // this checks if the password matchs
            if (!model.Password.Equals(model.ConfrimPassword))
            {
                ModelState.AddModelError("", "Passwords do not match.");
                return(View("CreateAccount", model));
            }

            using (DBLayer db = new DBLayer())
            {
                // thsi is used to make uure the username is unique
                if (db.Users.Any(x => x.Username.Equals(model.Username)))
                {
                    ModelState.AddModelError("", "Username " + model.Username + " is taken.");
                    model.Username = "";
                    return(View("CreateAccount", model));
                }

                // Create userDTO
                UserDTO userDTO = new UserDTO()
                {
                    Firstname    = model.Firstname,
                    Lastname     = model.Lastname,
                    EmailAddress = model.EmailAddress,
                    Username     = model.Username,
                    Password     = model.Password
                };

                // Add the DTO
                db.Users.Add(userDTO);

                // Save
                db.SaveChanges();

                // Add to UserRolesDTO
                int id = userDTO.Id;

                UserRoleDTO userRolesDTO = new UserRoleDTO()
                {
                    UserId = id,
                    RoleId = 2
                };

                db.UserRole.Add(userRolesDTO);
                db.SaveChanges();
            }

            // Create a TempData message
            TempData["SM"] = "You are now registered and can login.";

            // Redirect
            return(Redirect("~/account/login"));
        }
コード例 #33
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer dblayer = new DBLayer();

            dblayer.CreateConnectionString(Server.MapPath("."));

            String MAC   = Request["P1"];
            String EMail = Request["P2"];
            String VAT   = Request["P3"];

            if ((MAC != null) && (MAC != ""))
            {
                if ((EMail != null) && (EMail != ""))
                {
                    if ((VAT != null) && (VAT != ""))
                    {
                        MAC   = DecodeFrom64(MAC);
                        EMail = DecodeFrom64(EMail);
                        VAT   = DecodeFrom64(VAT);

                        Company company = dblayer.GetCompanyByKey(EMail, MAC, VAT);
                        //Response.Write(dblayer.ErrorList + "</br>");
                        if (company != null)
                        {
                            company.Active = true;
                            dblayer.UpdateCompany(company);
                            Label1.Visible = true;
                        }
                    }
                }
            }
        }
コード例 #34
0
        public static DataTable Get_ARDetails(Int64 SOID, string SoInvoiceNum)
        {
            DataTable table = null;

            try
            {
                // get a configured DbCommand object
                DbCommand   comm  = DBLayer.CreateCommand();
                DbParameter param = comm.CreateParameter();
                // set the stored procedure name
                comm.CommandText = "USB_Get_ArDetails";

                // create a new parameter
                param = comm.CreateParameter();
                param.ParameterName = "@So_ID";
                param.Value         = SOID;
                param.DbType        = DbType.Int64;
                comm.Parameters.Add(param);

                // create a new parameter
                param = comm.CreateParameter();
                param.ParameterName = "@SoInvoiceNum";
                param.Value         = SoInvoiceNum;
                param.DbType        = DbType.String;
                comm.Parameters.Add(param);

                // execute the stored procedure and save the results in a DataTable
                table = DBLayer.ExecuteSelectCommand(comm);
                return(table);
            }
            finally
            {
                table.Dispose();
            }
        }
コード例 #35
0
        public ActionResult Login(LoginUserView model)
        {
            //this cecks the model state
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            // Check if the user is valid

            bool isValid = false;

            using (DBLayer db = new DBLayer())
            {
                if (db.Users.Any(x => x.Username.Equals(model.Username) && x.Password.Equals(model.Password)))
                {
                    isValid = true;
                }
            }

            if (!isValid)
            {
                ModelState.AddModelError("", "Invalid username or password.");
                return(View(model));
            }
            else
            {
                FormsAuthentication.SetAuthCookie(model.Username, model.RememberMe);
                return(Redirect(FormsAuthentication.GetRedirectUrl(model.Username, model.RememberMe)));
            }
        }
コード例 #36
0
        protected void button1_Click(object sender, EventArgs e)
        {
            string adminUsername = txtAdminUsername.Text;

            string adminPassword = txtAdminPassword.Text;



            if ((adminUsername.Equals("")) || (adminPassword.Equals("")))
            {
                MessageBox.Show("please enter mandatory fields !!!");
            }

            else
            {
                objBAL = new BALayer();
                objDAL = new DBLayer();
                DataTable dtAdminBA = objBAL.adminLoginBA(txtAdminUsername.Text, txtAdminPassword.Text);
                if (dtAdminBA.Rows.Count == 1)
                {
                    MessageBox.Show("Congratulations!!!Logged in successful..");
                    objDAL.closeConn();


                    this.Hide();
                    Admin_Control_Page admincontrol = new Admin_Control_Page();
                    admincontrol.Show();
                }
                else
                {
                    MessageBox.Show("Please Enter Valid Credentials!!!");
                }
            }
        }
コード例 #37
0
        public static DataTable Get_PurchaseRegister(DateTime StartDate, DateTime EndDate)
        {
            DataTable table = null;

            try
            {
                // get a configured DbCommand object
                DbCommand comm = DBLayer.CreateCommand();
                // set the stored procedure name
                comm.CommandText = "USP_Report_PurchaseRegister";
                // create a new parameter
                DbParameter param = comm.CreateParameter();
                param.ParameterName = "@StartDate";
                param.Value         = StartDate;
                param.DbType        = DbType.DateTime;
                comm.Parameters.Add(param);
                // create a new parameter
                param = comm.CreateParameter();
                param.ParameterName = "@EndDate";
                param.Value         = EndDate;
                param.DbType        = DbType.DateTime;
                comm.Parameters.Add(param);


                // execute the stored procedure and save the results in a DataTable
                table = DBLayer.ExecuteSelectCommand(comm);
                return(table);
            }
            finally
            {
                table.Dispose();
            }
        }
コード例 #38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer dblayer = new DBLayer();

            dblayer.CreateConnectionString(Server.MapPath("."));

            String LoginKey = Request["LoginKey"];

            String CountryID  = Request["CountryID"];
            String CompanyVAT = Request["CompanyVAT"];
            String TimeStamp  = Request["TimeStamp"];

            //634815800923593750

            if ((LoginKey != null) && (LoginKey == "xezp3avnniqyjf45wso0ot45"))
            {
                if ((CountryID != null) && (CountryID != ""))
                {
                    if ((CompanyVAT != null) && (CompanyVAT != ""))
                    {
                        if ((TimeStamp != null) && (TimeStamp != ""))
                        {
                            dblayer.DeleteData(long.Parse(CountryID), CompanyVAT, TimeStamp);
                        }
                    }
                }
            }
        }
コード例 #39
0
        public static DataTable Get_SoDetailsFor_MaterialDispatch(Int64 SOID)
        {
            DataTable table = null;

            try
            {
                // get a configured DbCommand object
                DbCommand   comm  = DBLayer.CreateCommand();
                DbParameter param = comm.CreateParameter();
                // set the stored procedure name
                comm.CommandText = "USB_Get_SoDetailsFor_MaterialDispatch";

                // create a new parameter
                param = comm.CreateParameter();
                param.ParameterName = "@ID";
                param.Value         = SOID;
                param.DbType        = DbType.Int64;
                comm.Parameters.Add(param);

                // execute the stored procedure and save the results in a DataTable
                table = DBLayer.ExecuteSelectCommand(comm);
                return(table);
            }
            finally
            {
                table.Dispose();
            }
        }
コード例 #40
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     DataSet ds = new DataSet();
     ds = db.GetPageContent(2);
     uiLabelTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
     uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
 }
コード例 #41
0
 private void LoadDDls()
 {
     DBLayer db = new DBLayer();
     uiDropDownListCats.DataSource = db.GetAllCats();
     uiDropDownListCats.DataTextField = "CategoryName";
     uiDropDownListCats.DataValueField = "ID";
     uiDropDownListCats.DataBind();
 }
コード例 #42
0
 protected void uiDataListProductMedia_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         DBLayer db = new DBLayer();
         db.Deleteitem(Convert.ToInt32(e.CommandArgument));
         LoadProjectPhotos();
     }
 }
コード例 #43
0
        private void BindProducts()
        {
            DBLayer db = new DBLayer();
            DataSet ds = new DataSet();
            ds = db.GetAllProductByCatID(Convert.ToInt32(Request.QueryString["cid"].ToString()));

            uiRepeaterProducts.DataSource = ds;
            uiRepeaterProducts.DataBind();
        }
コード例 #44
0
    public DataTable GetExistingData()
    {
        DataTable dtExistingData = new DataTable();
        DBLayer dbLayerExistingData = new DBLayer();

        dtExistingData = dbLayerExistingData.GetExistingData();

        return dtExistingData;
    }
コード例 #45
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer db = new DBLayer();

            uiRepeaterCats.DataSource = db.GetAllCats();
            uiRepeaterCats.DataBind();

            uiRepeaterGallery.DataSource = db.GetAllProducts();
            uiRepeaterGallery.DataBind();
        }
コード例 #46
0
        protected void uiLinkButtonSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(Request.QueryString["TID"].ToString());
                DBLayer db = new DBLayer();
                DataSet ds = new DataSet();
                ds = db.GetTourismlistContent(id);

                MailMessage msg = new MailMessage();
                DataSet to = db.GetAllMails();
                foreach (DataRow item in to.Tables[0].Rows)
                {
                    msg.To.Add(item["Email"].ToString());
                }

                //msg.To.Add("*****@*****.**");
                msg.From = new MailAddress("*****@*****.**");
                //msg.From = new MailAddress("*****@*****.**");

                msg.Subject = " Email from booking page";
                msg.IsBodyHtml = true;
                msg.BodyEncoding = System.Text.Encoding.Unicode;

                msg.Body = " الإسم : " + uiDropDownListTitle.Text + " " + uiTextBoxName.Text;
                msg.Body += "<br/> البريد الإلكترونى : " + uiTextBoxEmail.Text;
                msg.Body += "<br/> الشارع : " + uiTextBoxStreet.Text;
                msg.Body += "<br/> المدينة : " + uiTextBoxCity.Text;
                msg.Body += "<br/> الرقم البريدى : " + uiTextBoxPostalCode.Text;
                msg.Body += "<br/> البلد : " + uiTextBoxCountry.Text;
                msg.Body += "<br/> التليفون : " + uiTextBoxTelephone.Text;
                msg.Body += "<br/> الموبايل : " + uiTextBoxMobile.Text;
                msg.Body += "<br/> إسم الرحلة : " + ds.Tables[0].Rows[0]["Title"].ToString();
                msg.Body += "<br/> تفاصيل  الرحلة : " + Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());

                msg.Body += "<br/> الرابط على الموقع : " + Request.Url;

                SmtpClient client = new SmtpClient("mail.obtravel-eg.com", 25);
                //SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
                //client.EnableSsl = true;
                client.UseDefaultCredentials = false;
                //client.EnableSsl = true;
                client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "obtravelmail");
                //client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "********");
                client.Send(msg);
                uiLabelMessage.Visible = true;
            }
            catch (Exception ex)
            {
                uiLabelMessage.Visible = true;
                uiLabelMessage.Text = ex.Message;
            }
        }
コード例 #47
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer db = new DBLayer();
            DataSet ds = new DataSet();
            ds = db.GetAllNews();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                uiLiteralTicker.Text += ds.Tables[0].Rows[i]["arContent"].ToString() + " | ";
            }

            uiLiteralTicker.Text = uiLiteralTicker.Text.Remove(uiLiteralTicker.Text.LastIndexOf("|"));
        }
コード例 #48
0
ファイル: About.ascx.cs プロジェクト: menasbeshay/ivalley-svn
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetBlockContent(2);
         uiLiteralTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
         uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arBrief"].ToString());
         uiImageBlock.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString();
     }
 }
コード例 #49
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DBLayer db = new DBLayer();
                DataSet ds = new DataSet();
                ds = db.GetPageContent(2);
                uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());

            }
            RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m5\").addClass(\"selected\");</script>");
        }
コード例 #50
0
 protected void uiLinkButtonUpdate_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     if (uiFileUploadPhoto.HasFile)
     {
         if (!string.IsNullOrEmpty(uiDropDownListCats.SelectedValue))
         {
             string path = "/UploadedFiles/gallery/" + DateTime.Now.ToString("ddMMyyyyhhmmss") + uiFileUploadPhoto.FileName;
             optimizePic("~" + path);
             db.AddProductContent(uiTextBoxTitle.Text, path, Convert.ToInt32(uiDropDownListCats.SelectedValue),"","","","");
             BindData();
         }
     }
 }
コード例 #51
0
 protected void uiLinkButtonSubmit_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     if (db.AddContactForm(uiTextBoxTelephone.Text, uiTextBoxMobile.Text, uiTextBoxEmail.Text, uiTextBoxSubject.Text, uiTextBoxName.Text, uiTextBoxStreet.Text, uiTextBoxCity.Text, uiTextBoxPostalCode.Text, uiTextBoxCountry.Text, uiDropDownListTitle.Text, Convert.ToInt32(uiDropDownListSection.SelectedValue)))
     {
         uiLabelSuccess.Visible = true;
         uiLabelFail.Visible = false;
     }
     else
     {
         uiLabelFail.Visible = true;
         uiLabelSuccess.Visible = false;
     }
 }
コード例 #52
0
        protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditPages")
            {
                DBLayer db = new DBLayer();
                CurrentPage = Convert.ToInt32(e.CommandArgument);
                DataSet ds = db.GetPageContent(CurrentPage);
                uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
                uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
                uiPanelViewPages.Visible = false;
                uiPanelEdit.Visible = true;

            }
        }
コード例 #53
0
 protected void uiGridViewContactForms_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "ViewContact")
     {
         DBLayer db = new DBLayer();
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         DataSet ds = new DataSet();
         ds = db.GetContactForm(id);
         uiLabelTelephone.Text = ds.Tables[0].Rows[0]["Telephone"].ToString();
         uiLabelMobile.Text = ds.Tables[0].Rows[0]["Mobile"].ToString();
         uiLabelEmail.Text = ds.Tables[0].Rows[0]["Email"].ToString();
         uiTextBoxSubject.Text = ds.Tables[0].Rows[0]["Subject"].ToString();
         uiPanelContactForms.Visible = false;
         uiPanelViewForm.Visible = true;
     }
 }
コード例 #54
0
 protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditPage")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentPage = id;
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetPageContent(id);
         if (ds.Tables[0].Rows.Count > 0)
         {
             uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
             uiFCKeditorContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());
         }
         uiPanelCurrentPages.Visible = false;
         uiPanelCurrent.Visible = true;
     }
 }
コード例 #55
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DBLayer dbLayer = new DBLayer();
        DataTable dtFieldIds = new DataTable();
        int updateFieldSuccess = 0;
        int countFieldUpdated = 0;

        dtFieldIds = dbLayer.GetFieldIds();

        for (int i = 0; i < dtFieldIds.Rows.Count; i++)
        {
            updateFieldSuccess = UpdateFields(Convert.ToInt32(dtFieldIds.Rows[i]["FIEL_Id"]));

            if (updateFieldSuccess == 1)
            {
                countFieldUpdated += 1;
            }
        }

        Response.Write("<h2>Number of fields updated= " + countFieldUpdated.ToString() + "</h2><br/><br/>");
    }
コード例 #56
0
ファイル: Login.aspx.cs プロジェクト: menasbeshay/ivalley-svn
 protected void uiLinkButtonLogin_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     DataSet ds = db.GetUser(uiTextBoxUserName.Text, uiTextBoxPassword.Text);
     uiLabelErrorLogin.Visible = false;
     if (ds != null)
     {
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             string user = ds.Tables[0].Rows[0]["UserName"].ToString();
             Session["CurrentUser"] = user;
             Response.Redirect("~/Admin/AdminCP.aspx");
         }
         else
         {
             uiLabelErrorLogin.Visible = true;
         }
     }
     else
     {
         uiLabelErrorLogin.Visible = true;
     }
 }
コード例 #57
0
ファイル: Node.aspx.cs プロジェクト: menasbeshay/ivalley-svn
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["PID"] != null && !string.IsNullOrEmpty(Request.QueryString["PID"].ToString()))
     {
         int id = Convert.ToInt32(Request.QueryString["PID"].ToString());
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetPageContent(id);
         if (ds.Tables[0].Rows.Count != 0)
         {
             uiLabelTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
             uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
         }
         else
         {
             Response.Redirect("Node.aspx?PID=2");
         }
     }
     else
     {
         Response.Redirect("Node.aspx?PID=2");
     }
 }
コード例 #58
0
        protected void uiGridViewDesigners_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditDesigner")
            {
                DBLayer db = new DBLayer();
                CurrentDesigner = Convert.ToInt32(e.CommandArgument);
                DataSet ds = db.GetDesignerContent(CurrentDesigner);
                uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
                uiTextBoxBrief.Text = ds.Tables[0].Rows[0]["Brief"].ToString();
                uiTextBoxName.Text = ds.Tables[0].Rows[0]["DesignerName"].ToString();
                uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
                uiPanelViewDesigners.Visible = false;
                uiPanelEdit.Visible = true;

            }
            else if (e.CommandName == "DeleteDesigner")
            {
                DBLayer db = new DBLayer();
                db.DeleteDesigner(Convert.ToInt32(e.CommandArgument));
                CurrentDesigner = 0;
                BindData();

            }
        }
コード例 #59
0
ファイル: MasterReportDao.cs プロジェクト: amalapannuru/RFC
 public MasterReportDao(DBLayer layer)
     : base(layer)
 { }
コード例 #60
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     uiRepeaterCurrentServices.DataSource = db.GetEnglishServices();
     uiRepeaterCurrentServices.DataBind();
 }