Example #1
0
        private void LoadSupplierDetails(int suppID)
        {
            DeltoneCRMDAL dal = new DeltoneCRMDAL();

            hdnEditSupplierID.Value = suppID.ToString();
            var suppObj = dal.SupplierIdById(suppID);

            NewItem.Value                = suppObj.SupplierName;
            NewCost.Value                = suppObj.StandardDeliveryCost;
            suppaddress.Value            = suppObj.Address;
            suppcity.Value               = suppObj.City;
            suppstate.Value              = suppObj.State;
            supppostcode.Value           = suppObj.PostCode;
            suppsalesemail.Value         = suppObj.SalesEmail;
            suppreturnemail.Value        = suppObj.ReturnEmail;
            suppphonenumber.Value        = suppObj.PhoneNumber;
            suppaccountPhonenumber.Value = suppObj.AccountsPhoneNumber;
            suppusername.Value           = suppObj.UserName;
            supppassword.Value           = suppObj.Password;
            contactnamesupp.Value        = suppObj.ContactName;
            contactnameemail.Value       = suppObj.AccountsEmail;
            suppnotes.Value              = suppObj.Notes;

            string strScript = "<script language='javascript'>$(document).ready(function (){$('#activechkbox').toggleCheckedState(true);});</script>";

            ScriptManager.RegisterStartupScript(this, this.GetType(), "PopupCP", strScript, false);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request.Form["NewItem"]) && !String.IsNullOrEmpty(Request.Form["NewCost"]))
            {
                String strDeliveryItem = Request.Form["NewItem"].ToString();
                float  deliveryCost    = float.Parse(Request.Form["NewCost"].ToString());

                DeltoneCRMDAL dal = new DeltoneCRMDAL();
                Response.Write(dal.AddNewDeliveryItem(strDeliveryItem, deliveryCost));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request.Form["NewItem"]) && !String.IsNullOrEmpty(Request.Form["NewCost"]) && !String.IsNullOrEmpty(Request.Form["NewDefaultQty"]) && !String.IsNullOrEmpty(Request.Form["NewShippingCost"]))
            {
                String strPromoItemName = Request.Form["NewItem"].ToString();
                float  ItemCost         = float.Parse(Request.Form["NewCost"].ToString());
                int    ItemQty          = int.Parse(Request.Form["NewDefaultQty"].ToString());
                float  ItemShipCost     = float.Parse(Request.Form["NewShippingCost"].ToString());

                DeltoneCRMDAL dal = new DeltoneCRMDAL();
                Response.Write(dal.AddNewPromoItem(strPromoItemName, ItemCost, ItemQty, ItemShipCost));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            String strSupplierID  = Request.Form["DropDownList1"].ToString();
            String strItemCode    = Request.Form["NewItemCode"].Trim().ToString();
            String strDescription = Request.Form["NewDescription"].Trim().ToString();
            float  cog            = float.Parse(Request.Form["NewCOG"].ToString());
            float  resellPrice    = float.Parse(Request.Form["NewResellPrice"].ToString());
            String bestprice      = Request.Form["Bestprice"].ToString();
            String faulty         = Request.Form["Faulty"].ToString();
            int    quantity       = 0;
            string qty            = Request.Form["Quantity"].ToString();

            if (!string.IsNullOrEmpty(qty))
            {
                quantity = Convert.ToInt32(qty);
            }
            double?dsb    = null;
            var    dsbVal = Request.Form["DSB"].ToString();

            if (!string.IsNullOrEmpty(dsbVal))
            {
                dsb = Convert.ToDouble(dsbVal);
            }
            String SendBP     = String.Empty;
            String SendFaulty = String.Empty;

            if (bestprice == "true")
            {
                SendBP = "Y";
            }
            else
            {
                SendBP = "N";
            }

            if (faulty == "true")
            {
                SendFaulty = "Y";
            }
            else
            {
                SendFaulty = "N";
            }

            //Response.Write(strDescription);

            DeltoneCRMDAL dal = new DeltoneCRMDAL();

            Response.Write(dal.AddNewItem(strSupplierID, strItemCode, strDescription, cog, resellPrice,
                                          SendBP, SendFaulty, quantity, dsb));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            String strFirstName = Request.Form["NewFirstName"].ToString();
            String strLastName  = Request.Form["NewLastName"].ToString();
            String strUsername  = Request.Form["NewUsername"].ToString();
            String strPassword  = Request.Form["NewPassword"].ToString();
            int    AccessLevel  = Int32.Parse(Request.Form["AccessLevel"].ToString());
            String strEmailAddy = Request.Form["NewEmailAddy"].ToString();
            int    Department   = Int32.Parse(Request.Form["Department"].ToString());

            DeltoneCRMDAL dal = new DeltoneCRMDAL();

            Response.Write(dal.AddNewLogin(strFirstName, strLastName, strUsername, strPassword, AccessLevel, strEmailAddy, Department));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            String strStaffID     = Request.Form["NewStaffMember"].ToString();
            float  strCommission  = float.Parse(Request.Form["NewCommission"].ToString());
            int    strWorkingDays = Int32.Parse(Request.Form["NewWorkingDays"].ToString());
            String strMonth       = Request.Form["NewMonth"].ToString();
            String strYear        = Request.Form["NewYear"].ToString();

            //Response.Write(strDescription);

            DeltoneCRMDAL dal = new DeltoneCRMDAL();

            Response.Write(dal.AddNewTarget(strStaffID, strCommission, strWorkingDays, strMonth, strYear));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Write(Request.Form["SupplierName"].ToString() + ":" + Request.Form["DeliveryCost"].ToString());

            if (!String.IsNullOrEmpty(Request.Form["SupplierName"]) && !String.IsNullOrEmpty(Request.Form["DeliveryCost"]))
            {
                String strSupplierName = Request.Form["SupplierName"].ToString();
                float  deliveryCost    = float.Parse(Request.Form["DeliveryCost"].ToString());

                String ContactName         = Request.Form["ContactName"].ToString();
                String PhoneNumber         = Request.Form["PhoneNumber"].ToString();
                String Address             = Request.Form["Address"].ToString();
                String City                = Request.Form["City"].ToString();
                String State               = Request.Form["State"].ToString();
                String PostCode            = Request.Form["PostCode"].ToString();
                String SalesEmail          = Request.Form["SalesEmail"].ToString();
                String ReturnEmail         = Request.Form["ReturnEmail"].ToString();
                String AccountsPhoneNumber = Request.Form["AccountsPhoneNumber"].ToString();
                String AccountsEmail       = Request.Form["AccountsEmail"].ToString();
                String Notes               = Request.Form["Notes"].ToString();
                String UserName            = Request.Form["UserName"].ToString();
                String Password            = Request.Form["Password"].ToString();

                var supplierObj = new DeltoneCRM.DeltoneCRMDAL.SupplierObj()
                {
                    StandardDeliveryCost = Request.Form["DeliveryCost"].ToString(),
                    SupplierName         = Request.Form["SupplierName"].ToString(),
                    ContactName          = ContactName,
                    PhoneNumber          = PhoneNumber,
                    Address             = Address,
                    City                = City,
                    State               = State,
                    PostCode            = PostCode,
                    SalesEmail          = SalesEmail,
                    ReturnEmail         = ReturnEmail,
                    AccountsPhoneNumber = AccountsPhoneNumber,
                    AccountsEmail       = AccountsEmail,
                    Notes               = Notes,
                    UserName            = UserName,
                    Password            = Password
                };

                DeltoneCRMDAL dal = new DeltoneCRMDAL();
                dal.AddNewSupplier(supplierObj);
                // Response.Write(dal.AddNewSupplier(strSupplierName,deliveryCost));
                Response.Write(1);
            }
        }
        public void UpdateCompanyReference(string companyName, string xeroReference)
        {
            companyName   = companyName.Trim();
            xeroReference = xeroReference.Trim();
            String        strConnectionString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;
            ContactDAL    cdal        = new ContactDAL(strConnectionString);
            var           comId       = 0;
            DeltoneCRMDAL dal         = new DeltoneCRMDAL();
            var           comIdByName = dal.GetCompanyIdByCompanyName(companyName);

            if (!string.IsNullOrEmpty(comIdByName))
            {
                comId = Convert.ToInt32(comIdByName);
                if (comId > 0)
                {
                    cdal.UpdateWithXeroDetails(comId, xeroReference);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            contactdal = new ContactDAL(CONNSTRING);
            xero       = new XeroIntergration();

            int    CompID          = Int32.Parse(Request.Form["CompID"].ToString());
            String FirstName       = Request.Form["NewFirstName"].ToString();
            String LastName        = Request.Form["NewLastName"].ToString();
            String DefaultAreaCode = Request.Form["NewDefaultAreaCode"].ToString();
            String DefaultNumber   = Request.Form["NewDefaultNumber"].ToString();
            String MobileNumber    = Request.Form["NewMobileNumber"].ToString();
            String EmailAddy       = Request.Form["NewEmailAddy"].ToString();
            String ShipLine1       = Request.Form["NewShipLine1"].ToString();
            String ShipLine2       = Request.Form["NewShipLine2"].ToString();
            String ShipCity        = Request.Form["NewShipCity"].ToString();
            String ShipState       = Request.Form["NewShipState"].ToString();
            String ShipPostcode    = Request.Form["NewShipPostcode"].ToString();
            String BillLine1       = Request.Form["NewBillLine1"].ToString();
            String BillLine2       = Request.Form["NewBillLine2"].ToString();
            String BillCity        = Request.Form["NewBillCity"].ToString();
            String BillState       = Request.Form["NewBillState"].ToString();
            String BillPostcode    = Request.Form["NewBillPostcode"].ToString();
            String PrimaryContact  = Request.Form["PrimaryContact"].ToString();


            String finalPrimaryContact = "";

            if (PrimaryContact == "true")
            {
                finalPrimaryContact = "Y";
            }
            else
            {
                finalPrimaryContact = "N";
            }

            DeltoneCRMDAL dal = new DeltoneCRMDAL();
            // Response.Write(dal.AddNewContact(CompID, FirstName, LastName, DefaultAreaCode, DefaultNumber, MobileNumber, EmailAddy, ShipLine1, ShipLine2, ShipCity, ShipState, ShipPostcode, BillLine1, BillLine2, BillCity, BillState, BillPostcode, finalPrimaryContact));
            var    loggedInUserId = Convert.ToInt32(Session["LoggedUserID"].ToString());
            String str            = dal.AddNewContact(CompID, FirstName, LastName, DefaultAreaCode, DefaultNumber, MobileNumber, EmailAddy, ShipLine1, ShipLine2,
                                                      ShipCity, ShipState, ShipPostcode, BillLine1, BillLine2, BillCity, BillState, BillPostcode, finalPrimaryContact, loggedInUserId);

            if (!String.IsNullOrEmpty(str))
            {
                String[] arr            = str.Split(':');
                String   contactID      = arr[1].ToString();
                String   companyname    = arr[2].ToString();
                String   companywebsite = arr[3].ToString();

                String strDefaultCountryCode = "+61";       //Should have entries in AddContactUI
                String strDefaultCountry     = "Australia"; //Should have entries in AddContactUI

                //Create the Repository

                Repository            res        = xero.CreateRepository();
                XeroApi.Model.Contact delContact = xero.CreateContact(res, companyname, FirstName, LastName, DefaultAreaCode, strDefaultCountryCode, DefaultNumber, String.Empty, String.Empty, String.Empty, String.Empty, strDefaultCountryCode, MobileNumber, EmailAddy, ShipLine1, ShipCity, strDefaultCountry, ShipPostcode, ShipState, BillLine1, BillCity, strDefaultCountry, BillPostcode, BillState);
                if (delContact != null)
                {
                    //Update the ContactGuid in the DataBase Table
                    contactdal.UpdateWithXeroDetails(CompID, delContact.ContactID.ToString());
                }
                else
                {
                }

                Response.Write(str);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            String strCompany    = Request.Form["NewCompany"].ToString();
            int    AccountOwner  = Int32.Parse(Request.Form["NewAccountOwner"].ToString());
            String strWebSite    = String.Empty;
            var    firstName     = "";
            var    lastName      = "";
            var    emailAddress  = "";
            var    isSkipChecked = "";

            if (!String.IsNullOrEmpty(Request.Form["FirstName"]))
            {
                firstName = Request.Form["FirstName"].ToString();
            }
            if (!String.IsNullOrEmpty(Request.Form["LastName"]))
            {
                lastName = Request.Form["LastName"].ToString();
            }
            if (!String.IsNullOrEmpty(Request.Form["EmailAddress"]))
            {
                emailAddress = Request.Form["EmailAddress"].ToString();
            }

            if (!String.IsNullOrEmpty(Request.Form["ISSkipClicked"]))
            {
                isSkipChecked = Request.Form["ISSkipClicked"].ToString();
            }



            if (!String.IsNullOrEmpty(Request.Form["NewWebsite"]))
            {
                strWebSite = Request.Form["NewWebsite"].ToString();
            }


            DeltoneCRMDAL dal        = new DeltoneCRMDAL();
            String        Comp_Count = dal.CompanyNameCount(strCompany);

            var userName = Session["LoggedUser"].ToString();

            if (Int32.Parse(Comp_Count) > 0)
            {
                SendNotificationEmail(strCompany, userName);
                Response.Write("ERROR");
            }
            else
            {
                if (!string.IsNullOrEmpty(isSkipChecked))
                {
                    var loggedInUserId = Convert.ToInt32(Session["LoggedUserID"].ToString());
                    Response.Write(dal.AddNewCompany(strCompany, strWebSite, AccountOwner, loggedInUserId));
                }
                else
                {
                    var connectionString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;
                    var contactDal       = new ContactDAL(connectionString);
                    var contact          = contactDal.GetContactByContactNameandEmail(firstName, lastName, emailAddress);
                    if (contact.ContactId > 0)
                    {
                        SendNotificationEmail(strCompany, userName);
                        Response.Write("ERROR");
                    }
                    else
                    {
                        var loggedInUserId = Convert.ToInt32(Session["LoggedUserID"].ToString());
                        Response.Write(dal.AddNewCompany(strCompany, strWebSite, AccountOwner, loggedInUserId));
                    }
                }
            }
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String      connString   = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;
            SupplierDAL suppdal      = new SupplierDAL(connString);
            int         SuppID       = Int32.Parse(Request.Form["suppid"].ToString());
            String      suppname     = Request.Form["suppname"].ToString();
            float       deliverycost = float.Parse(Request.Form["deliverycost"].ToString());
            string      ActInact     = Request.Form["ActInact"].ToString();

            string finalActInact = "";

            if (ActInact == "false")
            {
                finalActInact = "N";
            }
            else
            {
                finalActInact = "Y";
            }

            String ContactName         = Request.Form["ContactName"].ToString();
            String PhoneNumber         = Request.Form["PhoneNumber"].ToString();
            String Address             = Request.Form["Address"].ToString();
            String City                = Request.Form["City"].ToString();
            String State               = Request.Form["State"].ToString();
            String PostCode            = Request.Form["PostCode"].ToString();
            String SalesEmail          = Request.Form["SalesEmail"].ToString();
            String ReturnEmail         = Request.Form["ReturnEmail"].ToString();
            String AccountsPhoneNumber = Request.Form["AccountsPhoneNumber"].ToString();
            String AccountsEmail       = Request.Form["AccountsEmail"].ToString();
            String Notes               = Request.Form["Notes"].ToString();
            String UserName            = Request.Form["UserName"].ToString();
            String Password            = Request.Form["Password"].ToString();

            var supplierObj = new DeltoneCRM.DeltoneCRMDAL.SupplierObj()
            {
                SupplierID           = SuppID,
                StandardDeliveryCost = Request.Form["deliverycost"].ToString(),
                SupplierName         = Request.Form["suppname"].ToString(),
                ContactName          = ContactName,
                PhoneNumber          = PhoneNumber,
                Address             = Address,
                City                = City,
                State               = State,
                PostCode            = PostCode,
                SalesEmail          = SalesEmail,
                ReturnEmail         = ReturnEmail,
                AccountsPhoneNumber = AccountsPhoneNumber,
                AccountsEmail       = AccountsEmail,
                Notes               = Notes,
                UserName            = UserName,
                Password            = Password
            };

            var           userLoggedin = Session["LoggedUser"].ToString();
            DeltoneCRMDAL dal          = new DeltoneCRMDAL();

            dal.UpdateSupplierName(supplierObj, userLoggedin);
            Response.Write(1);
            // Response.Write(suppdal.UpdateSupplier(SuppID,suppname,deliverycost, finalActInact));
        }