public string approveSwitch(int empTake, int empAsk, int shift, string type)
    {
        ShiftsEmployee       se         = new ShiftsEmployee();
        int                  S          = se.approveSwitch(empTake, empAsk, shift, type);
        JavaScriptSerializer js         = new JavaScriptSerializer();
        string               jsonString = js.Serialize(S);

        return(jsonString);
    }
Example #2
0
    protected void ApproveSwitch(object sender, EventArgs e)
    {
        ShiftsEmployee se      = new ShiftsEmployee();
        int            empTake = Convert.ToInt32((string)Session["userID"]);
        string         temp    = DropDownList3.SelectedValue;

        string[] tempArr = DropDownList3.SelectedItem.Text.Split(' ');
        int      empAsk  = Convert.ToInt32(tempArr[2]);
        int      shift   = Convert.ToInt32(temp.Substring(0, 2));
        string   type    = temp.Substring(2);
        int      numEff  = 0;

        if (empAsk != empTake)
        {
            numEff = se.approveSwitch(empTake, empAsk, shift, type);
        }
        DropDownList1.Items.Clear();
        DropDownList2.Items.Clear();
        DropDownList3.Items.Clear();
        ShiftEmployee();
        Changes();
    }