private void SendData()
        {
            for (int i = 0; i <= 9; i++)
            {
                string[] input     = new string[6];
                var      container = Master.FindControl("Body");

                for (int i2 = 0; i2 <= 5; i2++)
                {
                    string tbName = "tbEdit" + i.ToString() + i2.ToString();
                    var    txtBox = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            goto track1;
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;

                    case 1:
                        input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 2:
                        input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 3:
                        input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 4:
                        input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 5:
                        input[i2] = (((TextBox)txtBox).Text.ToString());
                        break;
                    }
                }

                List <List <string> > ListContentCRA    = _business.GetCRADropDownContent();
                List <List <string> > ListContentDoctor = _business.GetDoctorDropDownContent();
                List <List <string> > ListContentSC     = _business.GetStudyCoordinatorDropDownContent();
                List <string>         Empty             = new List <string>();
                Empty.Add(string.Empty);
                List <List <string> > ListAll = new List <List <string> >();

                ListAll.Add(Empty);
                ListAll.Add(Empty);
                for (int i3 = 0; i3 < ListContentCRA.Count; i3++)
                {
                    ListAll.Add(ListContentCRA[i3]);
                }
                ListAll.Add(Empty);
                for (int i3 = 0; i3 < ListContentDoctor.Count; i3++)
                {
                    ListAll.Add(ListContentDoctor[i3]);
                }
                ListAll.Add(Empty);
                for (int i3 = 0; i3 < ListContentSC.Count; i3++)
                {
                    ListAll.Add(ListContentSC[i3]);
                }

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.User_ID);

                DateTime dt      = DateTime.Now;
                string   dateNow = dt.ToString("yyyy-MM-dd");

                string ddName       = "ddEdit" + i.ToString() + "0";
                var    dropdownData = container.FindControl(ddName) as DropDownList;
                string value        = dropdownData.SelectedValue;
                string name         = dropdownData.SelectedItem.Text;

                if (value.Contains("CR") == true)
                {
                    int valueInt = Convert.ToInt16(value.Remove(0, 2));
                    _business.AddEvaluation(Convert.ToDateTime(input[0]), input[1], input[2], input[3], input[4], input[5], valueInt, -1, -1, user.User_ID.ToString(), dateNow, dateNow);
                }
                else if (value.Contains("DR") == true)
                {
                    int valueInt = Convert.ToInt16(value.Remove(0, 2));
                    _business.AddEvaluation(Convert.ToDateTime(input[0]), input[1], input[2], input[3], input[4], input[5], -1, valueInt, -1, user.User_ID.ToString(), dateNow, dateNow);
                }
                else if (value.Contains("SC") == true)
                {
                    int valueInt = Convert.ToInt16(value.Remove(0, 2));
                    _business.AddEvaluation(Convert.ToDateTime(input[0]), input[1], input[2], input[3], input[4], input[5], -1, -1, valueInt, user.User_ID.ToString(), dateNow, dateNow);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Make sure you have selected a valid relation.')", true);
                }

                ListContentCRA.Clear();
                ListContentDoctor.Clear();
                ListContentSC.Clear();
                ListAll.Clear();

track1:
                continue;
            }
        }
Esempio n. 2
0
        private void SendData()
        {
            for (int i = 0; i <= 9; i++)
            {
                string[] input = new string[8];

                for (int i2 = 0; i2 <= 7; i2++)
                {
                    string tbName    = "tbEdit" + i.ToString() + i2.ToString();
                    var    container = Master.FindControl("Body");
                    var    txtBox    = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (((TextBox)txtBox).Text != "")
                        {
                            input[i2] = _businesscode.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        else
                        {
                            goto track1;
                        }
                        break;

                    case 1:
                        input[i2] = _businesscode.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 2:
                        input[i2] = (((TextBox)txtBox).Text.ToString());
                        break;

                    case 3:
                        input[i2] = _businesscode.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 4:
                        input[i2] = _businesscode.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 5:
                        input[i2] = _businesscode.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;

                    case 6:
                        input[i2] = (((TextBox)txtBox).Text.ToString());
                        break;

                    case 7:
                        input[i2] = _businesscode.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        break;
                    }
                }

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.ID);

                ClientCode client = new ClientCode(0, input[0], input[1], input[2], input[3], input[4], input[5], input[6], input[7], user.ID, DateTime.Now, DateTime.Now);
                _businesscode.AddClient(client);
track1:
                continue;
            }
        }
Esempio n. 3
0
        private void SendData()
        {
            for (int i = 0; i < 10; i++)
            {
                var      container = Master.FindControl("Body");
                string[] input     = new string[10];

                for (int i2 = 0; i2 <= 9; i2++) //--Var
                {
                    string tbName = "tbEdit" + i.ToString() + i2.ToString();
                    var    txtBox = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            goto track1;
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 1:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            if (_business.IsValidEmail(((TextBox)txtBox).Text.ToString()))
                            {
                                input[i2] = (((TextBox)txtBox).Text.ToString());
                            }
                            else
                            {
                                //error---------------------------------------
                                input[i2] = "error invalid email";
                            }
                        }

                        break;

                    case 2:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            if (_business.IsValidPhone(((TextBox)txtBox).Text.ToString()))
                            {
                                input[i2] = (((TextBox)txtBox).Text.ToString());
                            }
                            else
                            {
                                //error---------------------------------------
                                input[i2] = "error invalid phone";
                            }
                        }
                        break;

                    case 3:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            if (_business.IsValidPhone(((TextBox)txtBox).Text.ToString()))
                            {
                                input[i2] = (((TextBox)txtBox).Text.ToString());
                            }
                            else
                            {
                                //error---------------------------------------
                                input[i2] = "error invalid phone";
                            }
                        }
                        break;

                    case 4:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 5:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;

                    case 6:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 7:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 8:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 9:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;
                    }
                }

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.ID);

                DateTime dt      = DateTime.Now;
                string   dateNow = dt.ToString("yyyy-MM-dd");

                _business.AddDoctor(new DoctorCode(0, input[0], input[1], input[2], input[3], input[4], input[5], input[6], input[7], input[8], input[9], user.ID, Convert.ToDateTime(dateNow), Convert.ToDateTime(dateNow))); //--Var

                string lbName      = "lbEdit" + i.ToString() + "0";
                var    listboxData = container.FindControl(lbName) as ListBox;

                if (listboxData.SelectedIndex.ToString().Count() != 0)
                {
                    foreach (ListItem l in listboxData.Items)
                    {
                        if (l.Selected == true)
                        {
                            DoctorCode doctor = _business.GetDoctors(sortingPar).Last();                   //--Var
                            _business.AddHospitalToDoctor(Convert.ToInt32(l.Value.ToString()), doctor.ID); //--Var
                        }
                    }
                }
track1:
                continue;
            }
        }
Esempio n. 4
0
        private void SendData()
        {
            for (int i = 0; i < 10; i++)
            {
                var      container = Master.FindControl("Body");
                string[] input     = new string[6]; //--Var

                for (int i2 = 0; i2 <= 5; i2++)     //--Var
                {
                    string tbName = "tbEdit" + i.ToString() + i2.ToString();
                    var    txtBox = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            goto track1;
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 1:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }

                        break;

                    case 2:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;

                    case 3:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 4:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 5:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            if (_business.IsValidPhone(((TextBox)txtBox).Text.ToString()))
                            {
                                input[i2] = (((TextBox)txtBox).Text.ToString());
                            }
                            else
                            {
                                //error---------------------------------------
                                input[i2] = "error invalid phone";
                            }
                        }
                        break;
                    }
                }

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.ID);

                DateTime dt      = DateTime.Now;
                string   dateNow = dt.ToString("yyyy-MM-dd");

                _business.AddHospital(new HospitalCode(0, input[0], input[1], input[2], input[3], input[4], input[5], user.ID, Convert.ToDateTime(dateNow), Convert.ToDateTime(dateNow))); //--Var
track1:
                continue;
            }
        }
Esempio n. 5
0
        private void SendData()
        {
            List <List <string> > ListContentProject = _business.GetProjectDropDownContent();
            List <List <string> > ListContentClient  = _business.GetClientDropDownContent();
            var container = Master.FindControl("Body");

            for (int i = 0; i <= 9; i++)
            {
                string[] input = new string[4];

                for (int i2 = 0; i2 <= 3; i2++)
                {
                    string tbName = "tbEdit" + i.ToString() + i2.ToString();
                    var    txtBox = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (((TextBox)txtBox).Text != "")
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        else
                        {
                            goto track1;
                        }
                        break;

                    case 1:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = 0.ToString();
                            ;
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;

                    case 2:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = DateTime.Today.ToString();
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;

                    case 3:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = DateTime.Today.ToString();
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;
                    }
                }

                string ddNameProject       = "ddEdit" + i.ToString() + "0";
                var    dropdownDataProject = container.FindControl(ddNameProject) as DropDownList;
                int    indexProject        = dropdownDataProject.SelectedIndex;

                string ddNameClient       = "ddEdit" + i.ToString() + "1";
                var    dropdownDataClient = container.FindControl(ddNameClient) as DropDownList;
                int    indexClient        = dropdownDataClient.SelectedIndex;

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.ID);

                DateTime dt      = DateTime.Now;
                string   dateNow = dt.ToString("yyyy-MM-dd");

                if (indexClient < 1 || indexProject < 1)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Make sure you have selected a relation.')", true);
                }
                else
                {
                    _business.AddContract(new ContractCode(0, input[0], Convert.ToDouble(input[1]), Convert.ToDateTime(input[2]), Convert.ToDateTime(input[3]), Convert.ToInt16(ListContentClient[indexClient - 1][0]), Convert.ToInt16(ListContentProject[indexProject - 1][0]), user.ID, Convert.ToDateTime(dateNow), Convert.ToDateTime(dateNow)));
                }
track1:
                continue;
            }
        }
        private void SendData()
        {
            var container = Master.FindControl("Body");
            List <List <string> > ListContentHospital = _business.GetHospitalDropDownContent();

            for (int i = 0; i <= 9; i++)
            {
                string[] input = new string[10];

                for (int i2 = 0; i2 <= 9; i2++)
                {
                    string tbName = "tbEdit" + i.ToString() + i2.ToString();
                    var    txtBox = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            goto track1;
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 1:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            if (_business.IsValidEmail(((TextBox)txtBox).Text.ToString()))
                            {
                                input[i2] = (((TextBox)txtBox).Text.ToString());
                            }
                            else
                            {
                                //error---------------------------------------
                                input[i2] = "error invalid email";
                            }
                        }

                        break;

                    case 2:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = "";
                        }
                        else
                        {
                            if (_business.IsValidPhone(((TextBox)txtBox).Text.ToString()))
                            {
                                input[i2] = (((TextBox)txtBox).Text.ToString());
                            }
                            else
                            {
                                //error---------------------------------------
                                input[i2] = "error invalid phone";
                            }
                        }
                        break;
                    }
                }
                string ddName       = "ddEdit" + i.ToString() + "0";
                var    dropdownData = container.FindControl(ddName) as DropDownList;
                int    index        = dropdownData.SelectedIndex;

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.User_ID);

                DateTime dt      = DateTime.Now;
                string   dateNow = dt.ToString("yyyy-MM-dd");

                _business.AddDepartment(input[0], input[1], input[2], Convert.ToInt16(ListContentHospital[index - 1][0]), user.User_ID.ToString(), dateNow, dateNow);
track1:
                continue;
            }
        }
Esempio n. 7
0
        private void SendData()
        {
            for (int i = 0; i < 10; i++)
            {
                string lbName;
                var    listboxData = new ListBox();

                var      container = Master.FindControl("Body");
                string[] input     = new string[10];

                for (int i2 = 0; i2 <= 2; i2++) //--Var
                {
                    string tbName = "tbEdit" + i.ToString() + i2.ToString();
                    var    txtBox = container.FindControl(tbName);

                    switch (i2)
                    {
                    case 0:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            goto track1;
                        }
                        else
                        {
                            input[i2] = _business.BeginUpperCase((((TextBox)txtBox).Text.ToString()));
                        }
                        break;

                    case 1:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = DateTime.Today.ToString();
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;

                    case 2:
                        if (String.IsNullOrWhiteSpace(((TextBox)txtBox).Text.ToString()))
                        {
                            input[i2] = DateTime.Today.ToString();
                        }
                        else
                        {
                            input[i2] = (((TextBox)txtBox).Text.ToString());
                        }
                        break;
                    }
                }

                UserCode LoginUser = (UserCode)Session["authenticatedUser"];
                UserCode user      = GetCurrentUser(LoginUser.ID);

                DateTime dt      = DateTime.Now;
                string   dateNow = dt.ToString("yyyy-MM-dd");

                _business.AddProject(new ProjectCode(0, input[0], Convert.ToDateTime(input[1]), Convert.ToDateTime(input[2]), user.ID, Convert.ToDateTime(dateNow), Convert.ToDateTime(dateNow))); //--Var

                lbName      = "lbEdit" + i.ToString() + "0";
                listboxData = container.FindControl(lbName) as ListBox;

                if (listboxData.SelectedIndex.ToString().Count() != 0)
                {
                    foreach (ListItem l in listboxData.Items)
                    {
                        if (l.Selected == true)
                        {
                            ProjectCode Project = _business.GetProjects(sortingPar).Last();             //--Var
                            _business.AddCRAToProject(Convert.ToInt32(l.Value.ToString()), Project.ID); //--Var
                        }
                    }
                }

                lbName      = "lbEdit" + i.ToString() + "1";
                listboxData = container.FindControl(lbName) as ListBox;

                if (listboxData.SelectedIndex.ToString().Count() != 0)
                {
                    foreach (ListItem l in listboxData.Items)
                    {
                        if (l.Selected == true)
                        {
                            ProjectCode Project = _business.GetProjects(sortingPar).Last();                //--Var
                            _business.AddDoctorToProject(Convert.ToInt32(l.Value.ToString()), Project.ID); //--Var
                        }
                    }
                }

                lbName      = "lbEdit" + i.ToString() + "2";
                listboxData = container.FindControl(lbName) as ListBox;

                if (listboxData.SelectedIndex.ToString().Count() != 0)
                {
                    foreach (ListItem l in listboxData.Items)
                    {
                        if (l.Selected == true)
                        {
                            ProjectCode Project = _business.GetProjects(sortingPar).Last();                  //--Var
                            _business.AddHospitalToProject(Convert.ToInt32(l.Value.ToString()), Project.ID); //--Var
                        }
                    }
                }

                lbName      = "lbEdit" + i.ToString() + "3";
                listboxData = container.FindControl(lbName) as ListBox;

                if (listboxData.SelectedIndex.ToString().Count() != 0)
                {
                    foreach (ListItem l in listboxData.Items)
                    {
                        if (l.Selected == true)
                        {
                            ProjectCode Project = _business.GetProjects(sortingPar).Last();                        //--Var
                            _business.AddProjectManagerToProject(Convert.ToInt32(l.Value.ToString()), Project.ID); //--Var
                        }
                    }
                }

track1:
                continue;
            }
        }